From cd63cac2fe8a75609562f90d3f5aaaad4daa1b97 Mon Sep 17 00:00:00 2001 From: Ivan Ruzevic Date: Mon, 7 Jan 2019 11:05:24 +0100 Subject: [PATCH 01/19] some minor bug fixes --- admin/class-media.php | 5 + admin/class-users.php | 33 ----- admin/{class-widgets.php => class-widget.php} | 7 +- includes/class-main.php | 19 ++- package-lock.json | 119 ++++++------------ skin/assets/styles/utils/_helpers.scss | 70 +++++------ theme/class-theme.php | 6 +- 7 files changed, 85 insertions(+), 174 deletions(-) delete mode 100644 admin/class-users.php rename admin/{class-widgets.php => class-widget.php} (81%) diff --git a/admin/class-media.php b/admin/class-media.php index aad1b8ba..146876fa 100644 --- a/admin/class-media.php +++ b/admin/class-media.php @@ -60,6 +60,7 @@ public function enable_mime_types( $mimes ) { * @param array $response Array of prepared attachment data. * @param int|object $attachment Attachment ID or object. * + * @since 3.0.1 Adding theme review comments. * @since 3.0.0 Replacing file_get_content with file. * @since 2.0.2 Added checks if xml file is valid. * @since 1.0.0 @@ -74,6 +75,8 @@ public function enable_svg_library_preview( $response, $attachment ) { $svg_content = implode( ' ', $svg_content ); if ( ! $this->is_valid_xml( $svg_content ) ) { + + /* translators: path to file. */ new \WP_Error( sprintf( esc_html__( 'Error: File invalid: %s', 'inf_theme' ), $path ) ); return false; } @@ -96,6 +99,8 @@ public function enable_svg_library_preview( $response, $attachment ) { ); } } catch ( \Exception $e ) { + + /* translators: Exception error description. */ new \WP_Error( sprintf( esc_html__( 'Error: %s', 'inf_theme' ), $e ) ); } } diff --git a/admin/class-users.php b/admin/class-users.php deleted file mode 100644 index 0060388f..00000000 --- a/admin/class-users.php +++ /dev/null @@ -1,33 +0,0 @@ -user_email; - $subject = sprintf( esc_html__( 'Role changed: %s', 'inf_theme' ), $site_url ); - $message = sprintf( esc_html__( 'Hello %1$s, your role has changed on %2$s. Congratulations, you are now an %3$s.', 'inf_theme' ), $user_info->display_name, $site_url, $new_role ); - wp_mail( $to, $subject, $message ); - } - -} diff --git a/admin/class-widgets.php b/admin/class-widget.php similarity index 81% rename from admin/class-widgets.php rename to admin/class-widget.php index a599797a..0613544f 100644 --- a/admin/class-widgets.php +++ b/admin/class-widget.php @@ -1,7 +1,8 @@ loader->add_action( 'login_enqueue_scripts', $admin, 'enqueue_styles' ); @@ -100,11 +100,8 @@ private function define_admin_hooks() { // Editor. $this->loader->add_action( 'admin_init', $editor, 'add_editor_styles' ); - // Users. - $this->loader->add_action( 'set_user_role', $users, 'send_main_when_user_role_changes', 10, 2 ); - // Widgets. - $this->loader->add_action( 'widgets_init', $widgets, 'register_widget_position' ); + $this->loader->add_action( 'widgets_init', $widget, 'register_widget_position' ); // Menu. $this->loader->add_action( 'after_setup_theme', $menu, 'register_menu_positions' ); diff --git a/package-lock.json b/package-lock.json index 32c41a13..36eb449c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "inf_theme", - "version": "1.0.0", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1092,8 +1092,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "ansi-styles": { "version": "3.2.1", @@ -2313,8 +2312,7 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "collapse-white-space": { "version": "1.0.4", @@ -2633,11 +2631,20 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", + "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.5", + "is-windows": "^1.0.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -2962,8 +2969,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decamelize-keys": { "version": "1.1.0", @@ -3865,7 +3871,6 @@ "version": "0.10.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "dev": true, "requires": { "cross-spawn": "^6.0.0", "get-stream": "^3.0.0", @@ -5023,8 +5028,7 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, "get-stdin": { "version": "4.0.1", @@ -5035,8 +5039,7 @@ "get-stream": { "version": "3.0.0", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, "get-value": { "version": "2.0.6", @@ -5976,7 +5979,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6117,8 +6119,7 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, "is-supported-regexp-flag": { "version": "1.0.1", @@ -6205,8 +6206,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -6659,7 +6659,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", - "dev": true, "requires": { "p-defer": "^1.0.0" } @@ -6743,7 +6742,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "dev": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", @@ -6909,8 +6907,7 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "mini-css-extract-plugin": { "version": "0.4.4", @@ -7108,8 +7105,7 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-emoji": { "version": "1.8.1", @@ -7313,7 +7309,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, "requires": { "path-key": "^2.0.0" } @@ -7346,8 +7341,7 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { "version": "0.8.2", @@ -7583,20 +7577,17 @@ "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-is-promise": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" }, "p-limit": { "version": "1.3.0", @@ -7749,8 +7740,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { "version": "1.0.1", @@ -7766,8 +7756,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -9824,7 +9813,6 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-3.4.2.tgz", "integrity": "sha512-wb2EU5MBBqUty+b1xSIqa0IKs5M2/a+4Ldw8KM5Gpe1btv16K0eii6nMxyNhAmRZhCEPrge0ss5Ij9f7vJEYcw==", - "dev": true, "requires": { "chalk": "^2.4.1", "glob": "^7.1.2", @@ -9834,20 +9822,17 @@ "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, "requires": { "string-width": "^2.1.1", "strip-ansi": "^4.0.0", @@ -9858,7 +9843,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, "requires": { "locate-path": "^3.0.0" } @@ -9866,20 +9850,17 @@ "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, "requires": { "invert-kv": "^2.0.0" } @@ -9888,7 +9869,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, "requires": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -9898,7 +9878,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", - "dev": true, "requires": { "execa": "^0.10.0", "lcid": "^2.0.0", @@ -9909,7 +9888,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -9918,7 +9896,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, "requires": { "p-limit": "^2.0.0" } @@ -9926,14 +9903,12 @@ "p-try": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -9943,7 +9918,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, "requires": { "ansi-regex": "^3.0.0" } @@ -9951,14 +9925,12 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "yargs": { "version": "12.0.5", "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, "requires": { "cliui": "^4.0.0", "decamelize": "^1.2.0", @@ -9978,7 +9950,6 @@ "version": "11.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -10025,8 +9996,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-from-string": { "version": "2.0.2", @@ -10037,8 +10007,7 @@ "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "require-uncached": { "version": "1.0.3", @@ -10422,8 +10391,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { "version": "2.0.0", @@ -10493,7 +10461,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -10501,14 +10468,12 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-swizzle": { "version": "0.2.2", @@ -10988,7 +10953,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -11019,7 +10983,6 @@ "version": "3.0.1", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -11036,8 +10999,7 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { "version": "2.0.0", @@ -12541,7 +12503,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -12586,7 +12547,6 @@ "version": "2.1.0", "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -12643,8 +12603,7 @@ "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yallist": { "version": "2.1.2", diff --git a/skin/assets/styles/utils/_helpers.scss b/skin/assets/styles/utils/_helpers.scss index e5b2ae60..85bbb75a 100644 --- a/skin/assets/styles/utils/_helpers.scss +++ b/skin/assets/styles/utils/_helpers.scss @@ -19,41 +19,41 @@ } // Rotate helpers -.u-orientation--0 { - transform: rotate(0); -} +.u-orientation { + &--0 { + transform: rotate(0); + } -.u-orientation--90 { - transform: rotate(90deg); -} + &--90 { + transform: rotate(90deg); + } -.u-orientation--180 { - transform: rotate(180deg); -} + &--180 { + transform: rotate(180deg); + } -.u-orientation--270 { - transform: rotate(-90deg); + &--270 { + transform: rotate(-90deg); + } } // Utility for responive videos -.u { - &__embed-video-responsive { - position: relative; - display: block; - height: 0; - overflow: hidden; - padding-bottom: 56.25%; +.u-embed-video-responsive { + position: relative; + display: block; + height: 0; + overflow: hidden; + padding-bottom: 56.25%; - &__video, - iframe { // stylelint-disable-line selector-no-type - position: absolute; - top: 0; - bottom: 0; - left: 0; - width: 100%; - height: 100%; - border: 0; - } + &__video, + iframe { // stylelint-disable-line selector-no-type + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; } } @@ -65,20 +65,6 @@ display: none; } -.u-no-scroll { - overflow: hidden; - - &-ios, - &-mobile-navigation { - position: fixed; - left: 0; - top: 0; - width: 100%; - height: 100%; - overflow: hidden; - } -} - .clear { clear: both; } diff --git a/theme/class-theme.php b/theme/class-theme.php index 6dc4a152..d0aa32f4 100644 --- a/theme/class-theme.php +++ b/theme/class-theme.php @@ -36,14 +36,10 @@ public function enqueue_styles() { * 'enqueued' with empty string. This is done to avoid multiple jQuery loading, since * one is bundled with webpack and exposed to the global window. * + * @since 3.0.1 Removing jQuery deregistration. * @since 1.0.0 */ public function enqueue_scripts() { - // jQuery. - wp_deregister_script( 'jquery-migrate' ); - wp_deregister_script( 'jquery' ); - wp_register_script( 'jquery', General_Helper::get_manifest_assets_data( 'jquery.min.js' ), array(), '3.3.1' ); - wp_enqueue_script( 'jquery' ); // JS. wp_register_script( static::THEME_NAME . '-scripts-vendors', General_Helper::get_manifest_assets_data( 'vendors.js' ), array(), static::THEME_VERSION, true ); From 29067f707d8c0b05cc7fa76c0fc5aa2f805378cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Glogo=C5=A1ki?= Date: Fri, 8 Feb 2019 09:51:31 +0100 Subject: [PATCH 02/19] Add ellipsis only if the source string is longer than the limit --- theme/utils/class-excerpt.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/theme/utils/class-excerpt.php b/theme/utils/class-excerpt.php index 86af8951..aeb8abc0 100644 --- a/theme/utils/class-excerpt.php +++ b/theme/utils/class-excerpt.php @@ -39,9 +39,6 @@ public static function get_excerpt( $source = null, $limit = null ) { // Remove html tags. $output = wp_strip_all_tags( $output ); - // Reduce string to limit. - $output = substr( $output, 0, $limit ); - // Remove any whitespace character. $output = trim( preg_replace( '/\s+/', ' ', $output ) ); @@ -50,8 +47,13 @@ public static function get_excerpt( $source = null, $limit = null ) { $output = substr( $output, 0, strripos( $output, ' ' ) ); } - $output = '

' . $output . '...

'; + // Reduce string to limit. + $output = wp_trim_words( $output, $limit, '...' ); + + $output = '

' . $output . '

'; + return $output; + } } From b6f2a68a3020c96ac1d73310034ccbc9e74b221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Glogo=C5=A1ki?= Date: Wed, 13 Feb 2019 23:09:43 +0100 Subject: [PATCH 03/19] Remove paragraph wrapping --- theme/utils/class-excerpt.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/theme/utils/class-excerpt.php b/theme/utils/class-excerpt.php index aeb8abc0..ebcc3d2e 100644 --- a/theme/utils/class-excerpt.php +++ b/theme/utils/class-excerpt.php @@ -50,8 +50,6 @@ public static function get_excerpt( $source = null, $limit = null ) { // Reduce string to limit. $output = wp_trim_words( $output, $limit, '...' ); - $output = '

' . $output . '

'; - return $output; } From bb0090345b3e0f8fc87e8159ad90462415391058 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 4 Mar 2019 14:33:29 +0100 Subject: [PATCH 04/19] Fixing missing manifest entires while watching bug. --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 23702a4c..654be5b9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -111,7 +111,7 @@ const allPlugins = [ ]), // Create manifest.json file. - new ManifestPlugin(), + new ManifestPlugin({seed: {}}), ]; // General optimisations. From 0e8c590fe68d6933978eda37c6cad55676aac70f Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Wed, 20 Mar 2019 10:15:00 +0100 Subject: [PATCH 05/19] Added optional parameters to theme setup for branch, themeName, devUrl and noConfirm. --- bin/theme-setup.js | 36 ++++--- package-lock.json | 121 ++++++++---------------- package.json | 7 +- packages/create-wp-theme/theme-setup.js | 62 ++++++++---- 4 files changed, 113 insertions(+), 113 deletions(-) diff --git a/bin/theme-setup.js b/bin/theme-setup.js index 6b0df79b..9ba164b9 100644 --- a/bin/theme-setup.js +++ b/bin/theme-setup.js @@ -20,6 +20,9 @@ const success = (msg) => log(`${chalk.bgGreen(chalk.black(msg))}`); let themeName = ''; let fullThemePath = ''; +// Handle optional parameter args +const scriptArgs = require('minimist')(process.argv.slice(2)); + /** * Performs a wide search & replace. * @@ -59,12 +62,19 @@ const findReplace = async(findString, replaceString) => { * * @param array lines */ -const summary = (lines) => { +const summary = (lines, noConfirm) => { success(''); success('Your details will be:'); lines.forEach((line) => log(`${chalk(line.label)}: ${chalk.green(line.variable)}`)); success(''); - const confirm = prompt('Confirm (y/n)? '); + + let confirm; + if (noConfirm) { + confirm = 'y'; + } else { + confirm = prompt('Confirm (y/n)? '); + } + success(''); if (confirm === 'exit') { @@ -103,22 +113,26 @@ const promptFor = (settings) => { /** * Prompts the user only for theme name, Author name and dev URL, assume or ommit the rest */ -const promptThemeDataShort = () => { +const promptThemeDataShort = ({devUrl, noConfirm}) => { let confirmed = 'n'; const themeData = {}; do { // Dev url - themeData.url = promptFor({ - label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`, - prompt: 'Dev url (e.g. dev.wordpress.com): ', - error: 'Dev url is required and cannot be empty.', - }).trim(); + if (!devUrl) { + themeData.url = promptFor({ + label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`, + prompt: 'Dev url (e.g. dev.wordpress.com): ', + error: 'Dev url is required and cannot be empty.', + }).trim(); + } else { + themeData.url = devUrl; + } confirmed = summary([ {label: `${emoji.get('earth_africa')} Dev url`, variable: themeData.url}, - ]); + ], noConfirm); } while (confirmed !== 'y'); return themeData; @@ -188,7 +202,7 @@ const run = async() => { log(chalk.red('')); // Prompt user for all user data. - const newThemeData = promptThemeDataShort(); + const newThemeData = promptThemeDataShort(scriptArgs); // Globally save the package (because it's also our folder name) fullThemePath = path.join(process.cwd()); @@ -241,7 +255,7 @@ const run = async() => { // ----------------------------- const spinnerAutoloader = ora('4. Updating composer autoloader').start(); - await exec(`composer -o dump-autoload`).then(() => { + await exec('composer -o dump-autoload').then(() => { spinnerAutoloader.succeed(); }).catch((exception) => { spinnerAutoloader.fail(); diff --git a/package-lock.json b/package-lock.json index 32c41a13..7a856ee4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "inf_theme", - "version": "1.0.0", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1092,8 +1092,7 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" }, "ansi-styles": { "version": "3.2.1", @@ -2313,8 +2312,7 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "collapse-white-space": { "version": "1.0.4", @@ -2633,11 +2631,20 @@ "sha.js": "^2.4.8" } }, + "cross-env": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz", + "integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.5", + "is-windows": "^1.0.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -2962,8 +2969,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decamelize-keys": { "version": "1.1.0", @@ -3865,7 +3871,6 @@ "version": "0.10.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz", "integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==", - "dev": true, "requires": { "cross-spawn": "^6.0.0", "get-stream": "^3.0.0", @@ -5023,8 +5028,7 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, "get-stdin": { "version": "4.0.1", @@ -5035,8 +5039,7 @@ "get-stream": { "version": "3.0.0", "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" }, "get-value": { "version": "2.0.6", @@ -5976,7 +5979,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6117,8 +6119,7 @@ "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, "is-supported-regexp-flag": { "version": "1.0.1", @@ -6205,8 +6206,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -6659,7 +6659,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.2.tgz", "integrity": "sha512-UN1dNocxQq44IhJyMI4TU8phc2m9BddacHRPRjKGLYaF0jqd3xLz0jS0skpAU9WgYyoR4gHtUpzytNBS385FWQ==", - "dev": true, "requires": { "p-defer": "^1.0.0" } @@ -6743,7 +6742,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mem/-/mem-4.0.0.tgz", "integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==", - "dev": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", @@ -6909,8 +6907,7 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", - "dev": true + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, "mini-css-extract-plugin": { "version": "0.4.4", @@ -6945,7 +6942,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minimist-options": { @@ -7108,8 +7105,7 @@ "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", - "dev": true + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-emoji": { "version": "1.8.1", @@ -7313,7 +7309,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, "requires": { "path-key": "^2.0.0" } @@ -7346,8 +7341,7 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { "version": "0.8.2", @@ -7583,20 +7577,17 @@ "p-defer": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", - "dev": true + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" }, "p-finally": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-is-promise": { "version": "1.1.0", "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", - "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", - "dev": true + "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=" }, "p-limit": { "version": "1.3.0", @@ -7749,8 +7740,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { "version": "1.0.1", @@ -7766,8 +7756,7 @@ "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -9824,7 +9813,6 @@ "version": "3.4.2", "resolved": "https://registry.npmjs.org/replace-in-file/-/replace-in-file-3.4.2.tgz", "integrity": "sha512-wb2EU5MBBqUty+b1xSIqa0IKs5M2/a+4Ldw8KM5Gpe1btv16K0eii6nMxyNhAmRZhCEPrge0ss5Ij9f7vJEYcw==", - "dev": true, "requires": { "chalk": "^2.4.1", "glob": "^7.1.2", @@ -9834,20 +9822,17 @@ "ansi-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "camelcase": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", - "dev": true + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" }, "cliui": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "dev": true, "requires": { "string-width": "^2.1.1", "strip-ansi": "^4.0.0", @@ -9858,7 +9843,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, "requires": { "locate-path": "^3.0.0" } @@ -9866,20 +9850,17 @@ "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", - "dev": true + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", - "dev": true, "requires": { "invert-kv": "^2.0.0" } @@ -9888,7 +9869,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, "requires": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -9898,7 +9878,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.0.1.tgz", "integrity": "sha512-7g5e7dmXPtzcP4bgsZ8ixDVqA7oWYuEz4lOSujeWyliPai4gfVDiFIcwBg3aGCPnmSGfzOKTK3ccPn0CKv3DBw==", - "dev": true, "requires": { "execa": "^0.10.0", "lcid": "^2.0.0", @@ -9909,7 +9888,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", "integrity": "sha512-fl5s52lI5ahKCernzzIyAP0QAZbGIovtVHGwpcu1Jr/EpzLVDI2myISHwGqK7m8uQFugVWSrbxH7XnhGtvEc+A==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -9918,7 +9896,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, "requires": { "p-limit": "^2.0.0" } @@ -9926,14 +9903,12 @@ "p-try": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", - "dev": true + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -9943,7 +9918,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, "requires": { "ansi-regex": "^3.0.0" } @@ -9951,14 +9925,12 @@ "which-module": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", - "dev": true + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "yargs": { "version": "12.0.5", "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", - "dev": true, "requires": { "cliui": "^4.0.0", "decamelize": "^1.2.0", @@ -9978,7 +9950,6 @@ "version": "11.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", - "dev": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -10025,8 +9996,7 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-from-string": { "version": "2.0.2", @@ -10037,8 +10007,7 @@ "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "require-uncached": { "version": "1.0.3", @@ -10422,8 +10391,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { "version": "2.0.0", @@ -10493,7 +10461,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, "requires": { "shebang-regex": "^1.0.0" } @@ -10501,14 +10468,12 @@ "shebang-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "simple-swizzle": { "version": "0.2.2", @@ -10988,7 +10953,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -11019,7 +10983,6 @@ "version": "3.0.1", "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -11036,8 +10999,7 @@ "strip-eof": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { "version": "2.0.0", @@ -12541,7 +12503,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -12586,7 +12547,6 @@ "version": "2.1.0", "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -12643,8 +12603,7 @@ "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yallist": { "version": "2.1.2", diff --git a/package.json b/package.json index 82ed1e7a..82045866 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,8 @@ "uglifyjs-webpack-plugin": "^1.3.0", "webpack": "^4.17.1", "webpack-cli": "^3.1.0", - "webpack-manifest-plugin": "^2.0.3" + "webpack-manifest-plugin": "^2.0.3", + "minimist": "^1.2.0" }, "dependencies": { "@babel/polyfill": "^7.0.0", @@ -62,9 +63,9 @@ "media-blender": "^2.1.0", "normalize-scss": "^7.0.1", "postcss-font-magician": "^2.2.1", + "replace-in-file": "^3.4.2", "webfontloader": "^1.6.28", - "whatwg-fetch": "^2.0.4", - "replace-in-file": "^3.4.2" + "whatwg-fetch": "^2.0.4" }, "browserslist": [ "android >= 4.2", diff --git a/packages/create-wp-theme/theme-setup.js b/packages/create-wp-theme/theme-setup.js index 94f9b0af..a6977485 100644 --- a/packages/create-wp-theme/theme-setup.js +++ b/packages/create-wp-theme/theme-setup.js @@ -22,6 +22,9 @@ const success = (msg) => log(`${chalk.bgGreen(chalk.black(msg))}`); let fullThemePath = ''; +// Handle optional parameter args +const scriptArgs = require('minimist')(process.argv.slice(2)); + /** * Performs a wide search & replace. * @@ -61,12 +64,19 @@ const findReplace = async(findString, replaceString) => { * * @param array lines */ -const summary = (lines) => { +const summary = (lines, noConfirm) => { success(''); success('Your details will be:'); lines.forEach((line) => log(`${chalk(line.label)}: ${chalk.green(line.variable)}`)); success(''); - const confirm = prompt('Confirm (y/n)? '); + + let confirm; + if (noConfirm) { + confirm = 'y'; + } else { + confirm = prompt('Confirm (y/n)? '); + } + success(''); if (confirm === 'exit') { @@ -176,21 +186,25 @@ const promptThemeData = () => { /** * Prompts the user only for theme name, Author name and dev URL, assume or ommit the rest */ -const promptThemeDataShort = () => { +const promptThemeDataShort = ( {themeName, devUrl, noConfirm} ) => { let confirmed = 'n'; const themeData = {}; - + // ----------------------------- // Prompt for project info // ----------------------------- do { - themeData.name = promptFor({ - label: `${emoji.get('green_book')} Please enter your theme name (shown in WordPress admin):`, - prompt: 'Theme name: ', - error: 'Theme name field is required and cannot be empty.', - minLength: 2, - }).trim(); + if (!themeName) { + themeData.name = promptFor({ + label: `${emoji.get('green_book')} Please enter your theme name (shown in WordPress admin):`, + prompt: 'Theme name: ', + error: 'Theme name field is required and cannot be empty.', + minLength: 2, + }).trim(); + } else { + themeData.name = themeName; + } // Build package name from theme name themeData.package = themeData.name.toLowerCase().split(' ').join('_'); @@ -217,11 +231,15 @@ const promptThemeDataShort = () => { themeData.namespace = capCase(themeData.package); // Dev url - themeData.url = promptFor({ - label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`, - prompt: 'Dev url (e.g. dev.wordpress.com): ', - error: 'Dev url is required and cannot be empty.', - }).trim(); + if (!devUrl) { + themeData.url = promptFor({ + label: `${emoji.get('earth_africa')} Please enter a theme development url (for local development with browsersync - no protocol):`, + prompt: 'Dev url (e.g. dev.wordpress.com): ', + error: 'Dev url is required and cannot be empty.', + }).trim(); + } else { + themeData.url = devUrl; + } confirmed = summary([ {label: `${emoji.get('green_book')} Theme name`, variable: themeData.name}, @@ -229,7 +247,7 @@ const promptThemeDataShort = () => { {label: `${emoji.get('sun_behind_cloud')} Namespace`, variable: themeData.namespace}, {label: `${emoji.get('bullettrain_front')} Theme prefix`, variable: themeData.prefix}, {label: `${emoji.get('earth_africa')} Dev url`, variable: themeData.url}, - ]); + ], noConfirm); } while (confirmed !== 'y'); return themeData; @@ -370,7 +388,7 @@ const run = async() => { log(chalk.red('')); // Prompt user for all user data. - const newThemeData = promptThemeDataShort(); + const newThemeData = promptThemeDataShort(scriptArgs); // Globally save the package (because it's also our folder name) fullThemePath = path.join(process.cwd(), newThemeData.package); @@ -396,7 +414,15 @@ const run = async() => { // ----------------------------- const gitUrl = 'https://github.com/infinum/wp-boilerplate.git'; - const gitClone = `git clone ${gitUrl} "${newThemeData.package}"`; + let base = 'git clone'; + + // Pull from a different branch if specified in parameters + if (scriptArgs.branch) { + base += ` -b ${scriptArgs.branch}`; + } + + const gitClone = `${base} ${gitUrl} "${newThemeData.package}"`; + const spinnerClone = ora('2. Cloning theme repo').start(); await exec(`${gitClone} && cd "${fullThemePath}"`).then(() => { spinnerClone.succeed(); From 2e94a966446cab0ee417b2f5f2968c73fb409c79 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Wed, 20 Mar 2019 10:29:39 +0100 Subject: [PATCH 06/19] npm package version bump + added minimist as dependency. --- packages/create-wp-theme/package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/create-wp-theme/package.json b/packages/create-wp-theme/package.json index ae3c0e3f..490b7c3c 100644 --- a/packages/create-wp-theme/package.json +++ b/packages/create-wp-theme/package.json @@ -1,6 +1,6 @@ { "name": "create-wp-theme", - "version": "1.0.4", + "version": "1.0.5", "author": "Team Eightshift", "main": "", "license": "MIT", @@ -27,6 +27,7 @@ "ora": "^3.0.0", "promisify-child-process": "^2.1.2", "prompt-sync": "^4.1.6", - "fs-extra": "^7.0.1" + "fs-extra": "^7.0.1", + "minimist": "^1.2.0" } } From 8cf86e11754ad31d4c4c524cc002da898852e9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=BDoljom?= Date: Wed, 27 Mar 2019 16:56:02 +0100 Subject: [PATCH 07/19] Create CODE_OF_CONDUCT.md Create code of conduct for the project. I used the GitHub template, should be good enough. --- CODE_OF_CONDUCT.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..08bdd050 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at team@eightshift.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq From 04022cac1bc530d3613ce826fa54efd64d2f5a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Glogo=C5=A1ki?= Date: Sun, 7 Apr 2019 22:52:19 +0200 Subject: [PATCH 08/19] Flex grid mixin --- skin/assets/styles/utils/_mixins.scss | 1 + .../styles/utils/_shared-variables.scss | 4 + skin/assets/styles/utils/mixins/_flex.scss | 82 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 skin/assets/styles/utils/mixins/_flex.scss diff --git a/skin/assets/styles/utils/_mixins.scss b/skin/assets/styles/utils/_mixins.scss index 96d61896..02e5b7ee 100644 --- a/skin/assets/styles/utils/_mixins.scss +++ b/skin/assets/styles/utils/_mixins.scss @@ -4,3 +4,4 @@ @import 'mixins/forms'; @import 'mixins/buttons'; @import 'mixins/sections'; +@import 'mixins/flex'; diff --git a/skin/assets/styles/utils/_shared-variables.scss b/skin/assets/styles/utils/_shared-variables.scss index f908ee6d..13c3c326 100644 --- a/skin/assets/styles/utils/_shared-variables.scss +++ b/skin/assets/styles/utils/_shared-variables.scss @@ -7,6 +7,10 @@ $base-content-padding: 15px; $base-content-full-width: 1200px; $base-content-width: $base-content-full-width + ($base-content-padding*2); +// Grid +$base-gutter-size: $base-content-padding; +$base-col-number: 12; + //Typography $typography-map: ( mobile: ( diff --git a/skin/assets/styles/utils/mixins/_flex.scss b/skin/assets/styles/utils/mixins/_flex.scss new file mode 100644 index 00000000..dad3d52c --- /dev/null +++ b/skin/assets/styles/utils/mixins/_flex.scss @@ -0,0 +1,82 @@ +/* + * Mixin that creates flex grid. + * It should be applied to the container element that will act as grid row. + * All of the child elements will act as grid columns. + * Parameters to configure: + * + * * $layout - column width relative to th number of columns. If defined as a number all colums will be same width, + * and if set as a list width is set sequetially for each item. + * * $gutter - spacing between each item. + * * $col-count - max number of columns. + * * $horizontal - horizontal alignment of the items. Uses values for justify-content property. + * * $vertical - vertical alignment of th items. Uses valuse for align-items property. + * * $order - a list of item order overrides. + */ +@mixin flex-container( + $layout: (), + $gutter: $base-gutter-size, + $col-count: $base-col-number, + $horizontal: flex-start, + $vertical: stretch, + $order: 0 +) { + display: flex; + flex-wrap: wrap; + justify-content: $horizontal; + align-items: $vertical; + margin: 0 -#{$gutter}; + + & > * { + padding: 0 #{$gutter}; + } + + // Logic for defining layout of the columns. + @if length($layout) > 0 { + @if type-of($layout) == list { + // Looping over each item in $layout list and grabbing their index. + @for $index from 1 through length($layout) { + // Value of current item from the list. + $item: nth($layout, $index); + + // Child element selector for current index. + & > :nth-child( #{$index} ) { + // Setting the width of the column as a relation between max column number and width of the column. + flex: 0 0 #{100% / ( $col-count / $item )}; + max-width: #{100% / ( $col-count / $item )}; + } + } + } + // Setting the width of all columns as a relation between max column number and width of the columns. + @if type-of($layout) == number { + & > * { + flex: 0 0 #{100% / ( $col-count / $layout )}; + max-width: #{100% / ( $col-count / $layout )}; + } + } + } + // Fallback for undefined layout + @else { + & > * { + flex: 1 0 0; + max-width: 100%; + } + } + // Logic for defining order of the columns. + @if length($order) > 0 { + @if type-of($order) == list { + @for $index from 1 through length($order) { + $item: nth($order, $index); + + & > :nth-child( #{$index} ) { + order: $item; + } + } + } + @if type-of($order) == number { + & > * { + order: $order; + } + } + } + +} From 86ac626084bcc6bd2d3f3e9527dfa7763dcd77df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Glogo=C5=A1ki?= Date: Sun, 7 Apr 2019 23:00:58 +0200 Subject: [PATCH 09/19] Description update --- skin/assets/styles/utils/mixins/_flex.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skin/assets/styles/utils/mixins/_flex.scss b/skin/assets/styles/utils/mixins/_flex.scss index dad3d52c..cfbefeca 100644 --- a/skin/assets/styles/utils/mixins/_flex.scss +++ b/skin/assets/styles/utils/mixins/_flex.scss @@ -5,7 +5,7 @@ * Parameters to configure: * * * $layout - column width relative to th number of columns. If defined as a number all colums will be same width, - * and if set as a list width is set sequetially for each item. + * and if set as a list width is set sequentially for each item. * * $gutter - spacing between each item. * * $col-count - max number of columns. * * $horizontal - horizontal alignment of the items. Uses values for justify-content property. From 0c345c86ad9c9d2a5ce2e7425c6b68347f82e7f9 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 12:43:30 +0200 Subject: [PATCH 10/19] WordPress's jQuery as a dependancy. --- theme/class-theme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/class-theme.php b/theme/class-theme.php index d0aa32f4..d46ba183 100644 --- a/theme/class-theme.php +++ b/theme/class-theme.php @@ -42,7 +42,7 @@ public function enqueue_styles() { public function enqueue_scripts() { // JS. - wp_register_script( static::THEME_NAME . '-scripts-vendors', General_Helper::get_manifest_assets_data( 'vendors.js' ), array(), static::THEME_VERSION, true ); + wp_register_script( static::THEME_NAME . '-scripts-vendors', General_Helper::get_manifest_assets_data( 'vendors.js' ), array( 'jquery' ), static::THEME_VERSION, true ); wp_enqueue_script( static::THEME_NAME . '-scripts-vendors' ); wp_register_script( static::THEME_NAME . '-scripts', General_Helper::get_manifest_assets_data( 'application.js' ), array( static::THEME_NAME . '-scripts-vendors' ), static::THEME_VERSION, true ); @@ -53,7 +53,7 @@ public function enqueue_scripts() { static::THEME_NAME . '-scripts', 'themeLocalization', array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'ajaxurl' => admin_url( 'admin-ajax.php' ), ) ); } From e695a86cfe5c82d4cb47764e53d26565647a7695 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 13:39:59 +0200 Subject: [PATCH 11/19] Properly set phpcs rule file. --- phpcs.xml.dist | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 9a360fa8..c2667815 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,9 +1,8 @@ - + Loader for the Infinum coding standards for WordPress. - - + 0 From fefcfc07d47bb95c05abc0d5dd55a46f27b85e45 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 13:40:40 +0200 Subject: [PATCH 12/19] Better naming. --- phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c2667815..02b4dc33 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -1,5 +1,5 @@ - + Loader for the Infinum coding standards for WordPress. From 720f6e84ac45de70d39b26700e4909268e0e3a82 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 14:19:52 +0200 Subject: [PATCH 13/19] Updated composer. --- composer.lock | 235 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 201 insertions(+), 34 deletions(-) diff --git a/composer.lock b/composer.lock index e6441ef7..9e15880f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,34 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "73b987ccb74fe6f7a9a7f6d7ef2f2192", + "content-hash": "2ef6d71c3b61e718bfb9da1038acf9ee", "packages": [], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.4.4", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + "reference": "e749410375ff6fb7a040a68878c656c2e610b132" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", - "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", + "reference": "e749410375ff6fb7a040a68878c656c2e610b132", "shasum": "" }, "require": { "composer-plugin-api": "^1.0", "php": "^5.3|^7", - "squizlabs/php_codesniffer": "*" + "squizlabs/php_codesniffer": "^2|^3" }, "require-dev": { "composer/composer": "*", - "wimg/php-compatibility": "^8.0" - }, - "suggest": { - "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + "phpcompatibility/php-compatibility": "^9.0", + "sensiolabs/security-checker": "^4.1.0" }, "type": "composer-plugin", "extra": { @@ -49,13 +47,13 @@ "authors": [ { "name": "Franck Nijhof", - "email": "f.nijhof@dealerdirect.nl", - "homepage": "http://workingatdealerdirect.eu", - "role": "Developer" + "email": "franck.nijhof@dealerdirect.com", + "homepage": "http://www.frenck.nl", + "role": "Developer / IT Manager" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://workingatdealerdirect.eu", + "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", @@ -73,25 +71,36 @@ "stylecheck", "tests" ], - "time": "2017-12-06T16:27:17+00:00" + "time": "2018-10-26T13:21:45+00:00" }, { "name": "infinum/coding-standards-wp", - "version": "0.3.1", + "version": "0.4.1", "source": { "type": "git", "url": "https://github.com/infinum/coding-standards-wp.git", - "reference": "03ce9f035f930d225d3ffeb0f79b26ba52a0b6ef" + "reference": "87aa3608eb064308291f8f7f3d3d30a8fd1ea296" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/infinum/coding-standards-wp/zipball/03ce9f035f930d225d3ffeb0f79b26ba52a0b6ef", - "reference": "03ce9f035f930d225d3ffeb0f79b26ba52a0b6ef", + "url": "https://api.github.com/repos/infinum/coding-standards-wp/zipball/87aa3608eb064308291f8f7f3d3d30a8fd1ea296", + "reference": "87aa3608eb064308291f8f7f3d3d30a8fd1ea296", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "*", - "wp-coding-standards/wpcs": ">=1.0.0" + "php": ">=5.6", + "phpcompatibility/phpcompatibility-wp": "^2.0", + "squizlabs/php_codesniffer": "^3.3.0", + "wp-coding-standards/wpcs": "^1.0.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3", + "phpcompatibility/php-compatibility": "^9.0", + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0", + "roave/security-advisories": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -113,20 +122,178 @@ "standards", "wordpress" ], - "time": "2018-07-27T15:42:30+00:00" + "time": "2018-11-15T12:49:58+00:00" + }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.1.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "2b63c5d284ab8857f7b1d5c240ddb507a6b2293c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/2b63c5d284ab8857f7b1d5c240ddb507a6b2293c", + "reference": "2b63c5d284ab8857f7b1d5c240ddb507a6b2293c", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + }, + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2018-12-30T23:16:27+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "9160de79fcd683b5c99e9c4133728d91529753ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/9160de79fcd683b5c99e9c4133728d91529753ea", + "reference": "9160de79fcd683b5c99e9c4133728d91529753ea", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards" + ], + "time": "2018-12-16T19:10:44+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/cb303f0067cd5b366a41d4fb0e254fb40ff02efd", + "reference": "cb303f0067cd5b366a41d4fb0e254fb40ff02efd", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "wordpress" + ], + "time": "2018-10-07T18:31:37+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.3.2", + "version": "3.4.1", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e" + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e", - "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5b4333b4010625d29580eb4a41f1e53251be6baa", + "reference": "5b4333b4010625d29580eb4a41f1e53251be6baa", "shasum": "" }, "require": { @@ -159,25 +326,25 @@ } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], - "time": "2018-09-23T23:08:17+00:00" + "time": "2019-03-19T03:22:27+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "1.1.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", - "reference": "46d42828ce7355d8b3776e3171f2bda892d179b4" + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/46d42828ce7355d8b3776e3171f2bda892d179b4", - "reference": "46d42828ce7355d8b3776e3171f2bda892d179b4", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", + "reference": "f328bcafd97377e8e5e5d7b244d5ddbf301a3a5c", "shasum": "" }, "require": { @@ -185,7 +352,7 @@ "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" }, "require-dev": { - "phpcompatibility/php-compatibility": "*" + "phpcompatibility/php-compatibility": "^9.0" }, "suggest": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." @@ -207,7 +374,7 @@ "standards", "wordpress" ], - "time": "2018-09-10T17:04:05+00:00" + "time": "2018-12-18T09:43:51+00:00" } ], "aliases": [], From 3682bc51fae3a1fe057cf3134d7d5cb28df85ec1 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 15:18:51 +0200 Subject: [PATCH 14/19] fix-cs --- admin/class-media.php | 12 +++---- admin/class-widget.php | 14 ++++---- admin/menu/class-bem-menu-walker.php | 50 +++++++++++++--------------- admin/menu/class-menu.php | 20 +++++------ includes/class-loader.php | 10 +++--- search.php | 2 +- theme/utils/class-images.php | 14 ++++---- 7 files changed, 60 insertions(+), 62 deletions(-) diff --git a/admin/class-media.php b/admin/class-media.php index 146876fa..0378e0f3 100644 --- a/admin/class-media.php +++ b/admin/class-media.php @@ -92,10 +92,10 @@ public function enable_svg_library_preview( $response, $attachment ) { // media single. $response['sizes']['full'] = array( - 'height' => $height, - 'width' => $width, - 'url' => $src, - 'orientation' => $height > $width ? 'portrait' : 'landscape', + 'height' => $height, + 'width' => $width, + 'url' => $src, + 'orientation' => $height > $width ? 'portrait' : 'landscape', ); } } catch ( \Exception $e ) { @@ -127,8 +127,8 @@ public function check_svg_on_media_upload( $response ) { if ( file_exists( $path ) ) { if ( ! $this->is_valid_xml( $svg_content ) ) { return array( - 'size' => $response, - 'name' => $response['name'], + 'size' => $response, + 'name' => $response['name'], ); } } diff --git a/admin/class-widget.php b/admin/class-widget.php index 0613544f..6be9089a 100644 --- a/admin/class-widget.php +++ b/admin/class-widget.php @@ -22,13 +22,13 @@ class Widget { public function register_widget_position() { register_sidebar( array( - 'name' => esc_html__( 'Blog', 'inf_theme' ), - 'id' => 'blog', - 'description' => esc_html__( 'Description', 'inf_theme' ), - 'before_widget' => '', - 'after_widget' => '', - 'before_title' => '', - 'after_title' => '', + 'name' => esc_html__( 'Blog', 'inf_theme' ), + 'id' => 'blog', + 'description' => esc_html__( 'Description', 'inf_theme' ), + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', ) ); } diff --git a/admin/menu/class-bem-menu-walker.php b/admin/menu/class-bem-menu-walker.php index c779d43a..27df89fe 100644 --- a/admin/menu/class-bem-menu-walker.php +++ b/admin/menu/class-bem-menu-walker.php @@ -30,14 +30,14 @@ public function __construct( $css_class_prefix ) { // Define menu item names appropriately. $this->item_css_class_suffixes = array( - 'item' => '__item', - 'parent_item' => '__item--parent', - 'active_item' => '__item--active', - 'parent_of_active_item' => '__item--parent--active', - 'ancestor_of_active_item' => '__item--ancestor--active', - 'sub_menu' => '__sub-menu', - 'sub_menu_item' => '__sub-menu__item', - 'link' => '__link', + 'item' => '__item', + 'parent_item' => '__item--parent', + 'active_item' => '__item--active', + 'parent_of_active_item' => '__item--parent--active', + 'ancestor_of_active_item' => '__item--ancestor--active', + 'sub_menu' => '__sub-menu', + 'sub_menu_item' => '__sub-menu__item', + 'link' => '__link', ); } @@ -71,12 +71,11 @@ public function display_element( $element, &$children_elements, $max_depth, $dep * * @param array $output output. * @param integer $depth depth. - * @param array $args args. * @return void * * @since 1.0.0 */ - public function start_lvl( &$output, $depth = 1, $args = array() ) { + public function start_lvl( &$output, $depth = 1 ) { $real_depth = $depth + 1; @@ -86,8 +85,8 @@ public function start_lvl( &$output, $depth = 1, $args = array() ) { $suffix = $this->item_css_class_suffixes; $classes = array( - $prefix . $suffix['sub_menu'], - $prefix . $suffix['sub_menu'] . '--' . $real_depth, + $prefix . $suffix['sub_menu'], + $prefix . $suffix['sub_menu'] . '--' . $real_depth, ); $class_names = implode( ' ', $classes ); @@ -103,12 +102,11 @@ public function start_lvl( &$output, $depth = 1, $args = array() ) { * @param array $item item. * @param integer $depth depth. * @param array $args args. - * @param integer $id id. * @return void * * @since 1.0.0 */ - public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { + public function start_el( &$output, $item, $depth = 0, $args = array() ) { global $wp_query; @@ -132,14 +130,14 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 // Item classes. $item_classes = array( - 'item_class' => 0 === $depth ? $prefix . $suffix['item'] : '', - 'parent_class' => $args->has_children ? $parent_class : '', - 'active_page_class' => in_array( 'current-menu-item', $item->classes, true ) ? $prefix . $suffix['active_item'] : '', - 'active_parent_class' => in_array( 'current-menu-parent', $item->classes, true ) ? $prefix . $suffix['parent_of_active_item'] : '', - 'active_ancestor_class' => in_array( 'current-page-ancestor', $item->classes, true ) ? $prefix . $suffix['ancestor_of_active_item'] : '', - 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu_item'] . ' ' . $prefix . $suffix['sub_menu'] . '--' . $depth . '__item' : '', - 'item_id_class' => $prefix . '__item--' . $item->object_id, - 'user_class' => ! empty( $user_classes ) ? implode( ' ', $user_classes ) : '', + 'item_class' => 0 === $depth ? $prefix . $suffix['item'] : '', + 'parent_class' => $args->has_children ? $parent_class : '', + 'active_page_class' => in_array( 'current-menu-item', $item->classes, true ) ? $prefix . $suffix['active_item'] : '', + 'active_parent_class' => in_array( 'current-menu-parent', $item->classes, true ) ? $prefix . $suffix['parent_of_active_item'] : '', + 'active_ancestor_class' => in_array( 'current-page-ancestor', $item->classes, true ) ? $prefix . $suffix['ancestor_of_active_item'] : '', + 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu_item'] . ' ' . $prefix . $suffix['sub_menu'] . '--' . $depth . '__item' : '', + 'item_id_class' => $prefix . '__item--' . $item->object_id, + 'user_class' => ! empty( $user_classes ) ? implode( ' ', $user_classes ) : '', ); // Convert array to string excluding any empty values. @@ -150,8 +148,8 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 // Link classes. $link_classes = array( - 'item_link' => 0 === $depth ? $prefix . $suffix['link'] : '', - 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu'] . $suffix['link'] . ' ' . $prefix . $suffix['sub_menu'] . '--' . $depth . $suffix['link'] : '', + 'item_link' => 0 === $depth ? $prefix . $suffix['link'] : '', + 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu'] . $suffix['link'] . ' ' . $prefix . $suffix['sub_menu'] . '--' . $depth . $suffix['link'] : '', ); $link_class_string = implode( ' ', array_filter( $link_classes ) ); @@ -159,8 +157,8 @@ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 $link_class_output = 'class="' . $link_class_string . ' "'; $link_text_classes = array( - 'item_link' => 0 === $depth ? $prefix . $suffix['link'] . '-text' : '', - 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu'] . $suffix['link'] . '-text ' . $prefix . $suffix['sub_menu'] . '--' . $depth . $suffix['link'] . '-text' : '', + 'item_link' => 0 === $depth ? $prefix . $suffix['link'] . '-text' : '', + 'depth_class' => $depth >= 1 ? $prefix . $suffix['sub_menu'] . $suffix['link'] . '-text ' . $prefix . $suffix['sub_menu'] . '--' . $depth . $suffix['link'] . '-text' : '', ); $link_text_class_string = implode( ' ', array_filter( $link_text_classes ) ); diff --git a/admin/menu/class-menu.php b/admin/menu/class-menu.php index ac1b6faa..f0705e61 100644 --- a/admin/menu/class-menu.php +++ b/admin/menu/class-menu.php @@ -22,8 +22,8 @@ class Menu { */ public function get_menu_positions() { return array( - 'header_main_nav' => esc_html__( 'Main Menu', 'inf_theme' ), - 'footer_main_nav' => esc_html__( 'Footer Menu', 'inf_theme' ), + 'header_main_nav' => esc_html__( 'Main Menu', 'inf_theme' ), + 'footer_main_nav' => esc_html__( 'Footer Menu', 'inf_theme' ), ); } @@ -64,15 +64,15 @@ public function bem_menu( $location = 'main_menu', $css_class_prefix = 'main-men } $args = array( - 'theme_location' => $location, - 'container' => false, - 'items_wrap' => '
    %3$s
', - 'echo' => $echo, - 'walker' => new Bem_Menu_Walker( $css_class_prefix ), + 'theme_location' => $location, + 'container' => false, + 'items_wrap' => '
    %3$s
', + 'echo' => $echo, + 'walker' => new Bem_Menu_Walker( $css_class_prefix ), ); - if ( has_nav_menu( $location ) ) { - return wp_nav_menu( $args ); - } + if ( has_nav_menu( $location ) ) { + return wp_nav_menu( $args ); + } } } diff --git a/includes/class-loader.php b/includes/class-loader.php index 39034998..a24dc964 100644 --- a/includes/class-loader.php +++ b/includes/class-loader.php @@ -113,11 +113,11 @@ public function remove_filter( $hook, $function_to_remove, $priority = 10 ) { */ private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) { $hooks[] = array( - 'hook' => $hook, - 'component' => $component, - 'callback' => $callback, - 'priority' => $priority, - 'accepted_args' => $accepted_args, + 'hook' => $hook, + 'component' => $component, + 'callback' => $callback, + 'priority' => $priority, + 'accepted_args' => $accepted_args, ); return $hooks; diff --git a/search.php b/search.php index a6cb9817..df2a78e4 100644 --- a/search.php +++ b/search.php @@ -32,7 +32,7 @@ the_posts_pagination( array( - 'screen_reader_text' => ' ', + 'screen_reader_text' => ' ', ) ); diff --git a/theme/utils/class-images.php b/theme/utils/class-images.php index 0af8d07b..d620b3d2 100644 --- a/theme/utils/class-images.php +++ b/theme/utils/class-images.php @@ -39,16 +39,16 @@ public static function get_post_image( $size, $post_id = null, $no_image = null $image = wp_get_attachment_image_src( $attachemnt_id, $size ); $image_array = [ - 'image' => $image[0], - 'width' => $image[1], - 'height' => $image[2], + 'image' => $image[0], + 'width' => $image[1], + 'height' => $image[2], ]; } else { $no_img = General_Helper::get_manifest_assets_data( 'images/no-image-' . $size . '.jpg' ); $image_array = [ - 'image' => $no_img, - 'width' => '', - 'height' => '', + 'image' => $no_img, + 'width' => '', + 'height' => '', ]; if ( ! empty( $no_image ) ) { @@ -77,7 +77,7 @@ public static function get_image_from_array( $size, $image_array ) { } return [ - 'image' => $src, + 'image' => $src, ]; } From aed658ec777848c843470dd73ec918c708a5aae2 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 15:45:13 +0200 Subject: [PATCH 15/19] Fixed css hot-reloading not working. --- webpack.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webpack.config.js b/webpack.config.js index 654be5b9..266855d8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -89,7 +89,7 @@ const allPlugins = [ { match: [ '**/*.php', - `${themePublicPath}*.css`, + '**/*.css', ], }, ], From 0c06f166122a1398ed6871e6e749b38b1c30c1d4 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 15:45:32 +0200 Subject: [PATCH 16/19] Removing jquery from installed packages. --- package.json | 1 - webpack.config.js | 10 ---------- 2 files changed, 11 deletions(-) diff --git a/package.json b/package.json index 82045866..7ccc0252 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "autoprefixer": "^9.1.3", "css-mqpacker": "^7.0.0", "cssnano": "^4.1.0", - "jquery": "^3.3.1", "layzr.js": "^2.2.2", "media-blender": "^2.1.0", "normalize-scss": "^7.0.1", diff --git a/webpack.config.js b/webpack.config.js index 266855d8..7ed502c9 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -100,16 +100,6 @@ const allPlugins = [ }, ), - // Copy from one target to new destination. - new CopyWebpackPlugin([ - - // Find jQuery in node_modules and copy it to public folder - { - from: `${themeNodePath}/jquery/dist/jquery.min.js`, - to: themeOutput, - }, - ]), - // Create manifest.json file. new ManifestPlugin({seed: {}}), ]; From 97331bbd09f393a05c05ab0e8fb7ba00024b4c00 Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Mon, 8 Apr 2019 15:58:02 +0200 Subject: [PATCH 17/19] Ignorning some phpcs rules. --- admin/menu/class-bem-menu-walker.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/menu/class-bem-menu-walker.php b/admin/menu/class-bem-menu-walker.php index 27df89fe..158e1e79 100644 --- a/admin/menu/class-bem-menu-walker.php +++ b/admin/menu/class-bem-menu-walker.php @@ -71,11 +71,12 @@ public function display_element( $element, &$children_elements, $max_depth, $dep * * @param array $output output. * @param integer $depth depth. + * @param array $args args. * @return void * * @since 1.0.0 */ - public function start_lvl( &$output, $depth = 1 ) { + public function start_lvl( &$output, $depth = 1, $args = array() ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed $real_depth = $depth + 1; @@ -102,11 +103,12 @@ public function start_lvl( &$output, $depth = 1 ) { * @param array $item item. * @param integer $depth depth. * @param array $args args. + * @param integer $id id. * @return void * * @since 1.0.0 */ - public function start_el( &$output, $item, $depth = 0, $args = array() ) { + public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed global $wp_query; From f78856c9eb78901a0087a3e9406676b4574a97bf Mon Sep 17 00:00:00 2001 From: Ivan Grginov Date: Tue, 9 Apr 2019 10:34:24 +0200 Subject: [PATCH 18/19] Updated coding standards version. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9fd9e3cd..1737c6cd 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "infinum/coding-standards-wp": "*", + "infinum/coding-standards-wp": "0.4.1", "dealerdirect/phpcodesniffer-composer-installer": "^0.5" }, "autoload": { From f206377156eaa98c6ba50963112aa0f69f0f687e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20=C5=BDoljom?= Date: Tue, 23 Apr 2019 11:49:38 +0200 Subject: [PATCH 19/19] Add changelog --- CHANGELOG.md | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..eb0f5d4c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,158 @@ +# Change Log for the Eightshift WordPress Boilerplate + +All notable changes to this project will be documented in this file. + +This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). + +## [Unreleased] + +_No documentation available about unreleased changes as of yet._ + +## [3.0.1] - 2019-04-23 + +### Added + +- Added code of conduct +- Minor phpcs fixes +- Added changelog +- Added widget class +- Minor updates to setup script +- Added flex grid mixin + +### Changed + +- phpcs.xml.dist ruleset name change +- Refactored scss assets +- Minor refactor in excerpt class + +### Removed + +- Remove jQuery override so that the theme obey wordpress.org rules + +### Fixed + +- Minor webpack config fix + +## [3.0.0] - 2019-01-03 + +### Added + +- Added setup wizard guide for easier theme setup + +### Changed + +- Travis update +- phpcs fixes +- Renamed Infinum -> Eightshift, since that is our new brand +- Updates in package.json and composer.json +- phpcs.xml.dist updates +- Added husky for precommit scripts +- Added object helper +- Cleaned assets + +### Deprecated + +- Boilerplate acts as a standalone theme now + +### Removed + +- Replaced `file_get_contents` with `file` (for support) + +### Fixed + +## [2.1.1] - 2018-05-03 + +### Added + +- Travis integration +- Issue and contributing template +- Change color admin based on the environment (dev, staging, production) +- Added phpcs.xml.dist for the project +- Added validate xml helper for svg uploads +- Added lazy loading images feature + +### Changed + +- License update +- Small codebase changes +- Changes in @since tags + +### Removed + +- ACF functionality from the boilerplate +- jQuery webpack exposing due to admin issues + +### Fixed + +- Autoloader path fix +- Fixed setup script +- Fixed rename script +- Minor phpcs fixes + +### Security + +## [2.0.1] - 2018-02-07 + +### Added + +- Locale class for translation handling +- Assets cache busting + +### Changed + +- Updated readme +- Updated eslintrc +- Updated stylelintrc +- Updated .gitignore +- Updated coding standards, added composer scripts + +### Removed + +- Removed ACF class from the boilerplate +- Removed unnecessary register_global_theme_options_variable method that set global variable + +## [2.0.0] - 2018-01-19 + +This build is a breaking change in comparison to v1.0.0 (procedural -> OOP) + +### Added + +- Added namespaces, autoloader, webpack 3+ +- Added import/export scripts +- Added project setup script +- Added util class +- Added ACF class +- Added theme options and helpers + +### Changed + +- Changed codebase to OOP +- Readme update +- Updated documentation +- .gitignore file update +- Asset update + +### Deprecated + +- Removed procedural code and updated the codebase to OOP + +### Removed + +- Removed jQuery from WP (used webpack to bundle it) + +### Fixed + +- Rename scripts minor fix with theme package name (shell script) +- Indentation fix + +## [1.0.0] - 2018-01-03 + +Initial tagged release. + +[Unreleased]: https://github.com/infinum/wp-boilerplate/compare/master...HEAD +[3.0.1]: https://github.com/infinum/wp-boilerplate/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/infinum/wp-boilerplate/compare/2.1.1...3.0.0 +[2.1.1]: https://github.com/infinum/wp-boilerplate/compare/2.0.1...2.1.1 +[2.0.1]: https://github.com/infinum/wp-boilerplate/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/infinum/wp-boilerplate/compare/1.0.0...2.0.0 +[1.0.0]: https://github.com/infinum/wp-boilerplate/compare/26115acf804876208a03dc39298b70476dcc780f...1.0.0