From 8a24ace6261dc4ab72b99321cb2ea6579e0e1b74 Mon Sep 17 00:00:00 2001 From: Git I Hate You Date: Tue, 14 Jan 2020 00:49:22 +0100 Subject: [PATCH 1/6] Added PHPCS rules --- phpcs.xml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 phpcs.xml diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..214995a --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,35 @@ + + + Helper plugins for Imagify. + + + + . + + + + + + + + *\.php$ + + + + + + + + + + + + + + + + + + + + From 51528b16114f88c98ec47f3b5f20e667e926a748 Mon Sep 17 00:00:00 2001 From: Git I Hate You Date: Tue, 14 Jan 2020 00:53:35 +0100 Subject: [PATCH 2/6] Improved plugins template - File header with new entries. - Modified the namespace. - Replaced the `or` statement by `||`. - Put the `add_action()` before the function. - Added a `@since` tag to the function DocBlock. --- .../imagify-helper-plugin.php | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/_imagify-helper-plugin/imagify-helper-plugin.php b/_imagify-helper-plugin/imagify-helper-plugin.php index 2918030..0870c85 100644 --- a/_imagify-helper-plugin/imagify-helper-plugin.php +++ b/_imagify-helper-plugin/imagify-helper-plugin.php @@ -1,37 +1,40 @@ Date: Tue, 14 Jan 2020 00:54:16 +0100 Subject: [PATCH 3/6] Modified the existing helpers to fit the template and the new PHPCS rules. --- .../imagify-bulk-buffer-size.php | 32 ++++++------ .../imagify-bulk-buffer-size.zip | Bin 1343 -> 1497 bytes .../imagify-no-auto-optimize-pdf.php | 29 ++++++----- .../imagify-no-auto-optimize-pdf.zip | Bin 1504 -> 1576 bytes .../imagify-reset-optimization-status.php | 23 +++++---- .../imagify-reset-optimization-status.zip | Bin 1840 -> 1931 bytes .../imagify-capacity-bulk-optimize.php | 46 ++++++++++++------ .../imagify-capacity-bulk-optimize.zip | Bin 1649 -> 1744 bytes 8 files changed, 78 insertions(+), 52 deletions(-) diff --git a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php index 9cb9d2a..3e07dc5 100644 --- a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php +++ b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php @@ -3,30 +3,34 @@ * Plugin Name: Imagify | Change Bulk Buffer Size * Description: Helps to avoid CPU issues during bulk optimization. * Plugin URI: https://github.com/wp-media/imagify-helpers/tree/master/optimization/imagify-bulk-buffer-size/ - * Author: Imagify Support Team - * Author URI: http://imagify.io/ - * License: GNU General Public License v2 or later - * License URI: http://www.gnu.org/licenses/gpl-2.0.html + * Version: 1.1 + * Requires PHP: 5.3 + * Author: Imagify Support Team + * Author URI: http://imagify.io/ + * License: GPLv2 + * License URI: http://www.gnu.org/licenses/gpl-2.0.html * - * Copyright SAS WP MEDIA 2018 + * Copyright 2020 WP Media + * + * @package WP-Media\ImagifyPluginHelpers\BulkBufferSize */ -namespace ImagifyPlugin\Helpers\optimization\bulk; -defined( 'ABSPATH' ) or die(); +namespace ImagifyPluginHelpers\Optimization\BulkBufferSize; + +defined( 'ABSPATH' ) || die(); add_filter( 'imagify_bulk_buffer_sizes', __NAMESPACE__ . '\buffer_sizes', 10, 3 ); /** - * Prevent automatic optimization for PDF. + * Allow only one optimization at the same time during bulk optimization, for all contexts. * + * @since 1.0 * @author Grégory Viguier * @author Caspar Hübinger * - * @param array $buffer_sizes An array of number of parallel queries - * @return array Modified array + * @param array $buffer_sizes An array of number of parallel queries. Array keys are contexts, like 'wp' and 'custom-folders'. + * @return array Modified array. */ function buffer_sizes( $buffer_sizes ) { - - $buffer = array_keys( $buffer_sizes ); - - return array_fill_keys( $buffer_sizes, 1 ); + $contexts = array_keys( $buffer_sizes ); + return array_fill_keys( $contexts, 1 ); } diff --git a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.zip b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.zip index 277a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JX*fA{i4as8DIPxxPG zFUtrzn|*q!%wZna+yhz((MOGE=!6~UEzD3To^_hZEY4AI_apu@*IV|kTkUV2+;HjE zt)9gz9&9U_Z4er|WwpC#+8ozCr6yV{`Ll#0dnH28L|h4s|H^;y`{Kjaa*{XoZX5!N3`m7V7i$70XuED#_>H25Un8hw4P)la-LGW9rJ{T8iq6rzb!NA|uHntO%b)r7aHTAZ z`}(rN?n_L?VWCenYd@JNs0(+$Z2w^JyZYL?CsFqQbf(-poE~R!FYQ*Mu-oPA8Mgm! zT`11pz_!dgjL~52O}V%)xsE#g*R|MRuHxOB`|C4ng42SA^?au8msezL@hktb{QlZg z73U1I52lIloSbRwzW?sW&F|Dd=yLS&m4Dc#>;JCszy9Q~!YkzurYrq(U%J5dxBCZa zL^`tqrqZ55x1URZsqQWiD}mFQDmO5ZZ2%^)O+Y+(8S_?EMkYCCTm>Skf5GFu9&p8kn>}dO=AWMK7ick@Y@j0_s)M0cr#} X7b82dvVk1N41`WVyPg9x5(5JO5oS~F diff --git a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php index c44e946..4e77610 100644 --- a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php +++ b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php @@ -3,30 +3,35 @@ * Plugin Name: Imagify | No Auto-Optimization for PDFs * Description: Excludes PDF files from being auto-optimized once they’re uploaded. * Plugin URI: https://github.com/wp-media/imagify-helpers/tree/master/optimization/imagify-no-auto-optimize-pdf/ - * Author: Imagify Support Team - * Author URI: http://imagify.io/ - * License: GNU General Public License v2 or later - * License URI: http://www.gnu.org/licenses/gpl-2.0.html + * Version: 1.0.1 + * Requires PHP: 5.3 + * Author: Imagify Support Team + * Author URI: http://imagify.io/ + * License: GPLv2 + * License URI: http://www.gnu.org/licenses/gpl-2.0.html * - * Copyright SAS WP MEDIA 2018 + * Copyright 2020 WP Media + * + * @package WP-Media\ImagifyPluginHelpers\NoAutoOptimPDF */ -namespace ImagifyPlugin\Helpers\optimization\auto; -defined( 'ABSPATH' ) or die(); +namespace ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; + +defined( 'ABSPATH' ) || die(); -add_filter( 'imagify_auto_optimize_attachment', __NAMESPACE__ . '\no_optimize_pdf', 10, 3 ); +add_filter( 'imagify_auto_optimize_attachment', __NAMESPACE__ . '\no_optimize_pdf', 10, 2 ); /** * Prevent automatic optimization for PDF. * + * @since 1.0 * @author Grégory Viguier * @author Caspar Hübinger * - * @param bool $optimize True to optimize, false otherwise. - * @param int $attachment_id Attachment ID. - * @param array $metadata An array of attachment meta data. + * @param bool $optimize True to optimize, false otherwise. + * @param int $attachment_id Attachment ID. * @return bool */ -function no_optimize_pdf( $optimize, $attachment_id, $metadata ) { +function no_optimize_pdf( $optimize, $attachment_id ) { if ( ! $optimize ) { return false; } diff --git a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.zip b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.zip index 4464edb1e4be809eea2fe9da8e2918fb888e36a1..33665d514edce60909c3995c09a965527d676ff8 100644 GIT binary patch delta 1129 zcmaFBy@E$Jz?+#xgaHJ)nDqj{3@9PXpfFKZ!J3zWUF5G!oDvX&=+X*q21b^zj0_B5 zZ4m7o3>*w5J9XjOMS;?4AnkHeL9UK2zOH(?DWM@ila{`ciIe;;69=LvuDGVn&Y{*U zc;_h4MvxYSVa7;qS;xY_U<)>E@^(h0dY~yqe`Ml{ffz)ixhFR`Fz>R1z~4T9!>L-T zYlW9f;3ANIPxQ+Gu zx3j;e#qSN9`Kjq|E&sQ~dEuJ+3CCFa9{OyUqOQH8eP&C&XX=v&%|MLe$qO2X`a)e;$PDTMG7bKZ0Zp3XorviQl@W^7`kGG0ZevCByD`$~R2+k4IO+N;anCb4+pCvMDpPucRiJBq>B>2C#2h zT6sC*#6f#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2h~G>%mUDX1EFdxDbER zPgAxrD{cz6Z9BQ$ ztR!|+{n)JLer>0fuVcL$!!<8ahIZYx$GFXxDa~J1X2z$O${Oo6vHWb?^cUrd79UkR z{=O6RSE%{Zbn}U)rEy#C!+-^;oSWColsFX|vvdPHQ#i}IRgMN3+REAIzD~XDb!@BN z`4-tX;!<|XW^a7#n%>9tFE?mt?qe$5vRyj#eeJWa?`+qXYwS31BG2@Yw`EF(@>(xx zTQ>Idss-~h3xD}!e=7c*yzBDegFh|b2%g_l{a!x6n~_P58CS-UfMy|q$>&+roLM2+ z2Q4i_Ou&_SASM9w5yO(ka0UiYMg(OgkXfLtgwHIDT!m~_4I{`b2OXd}pge|Q4l5hT Q>C8YF1hl*Ym@63=05cMNI{*Lx diff --git a/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php b/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php index a8d7646..82d3f0b 100644 --- a/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php +++ b/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php @@ -3,28 +3,31 @@ * Plugin Name: Imagify | Reset Optimization Status * Description: Will “reset” Imagify’s optimization status in the database, so that previously optimized images will be considered not optimized. Physical image files will not actually be modified! How to use: 1. Activate plugin. 2. Reload plugin page once. 3. Deactivate plugin! * Plugin URI: https://github.com/wp-media/imagify-helpers/tree/master/optimization/imagify-reset-optimization-status/ - * Author: Imagify Support Team - * Author URI: http://imagify.io/ - * License: GNU General Public License v2 or later - * License URI: http://www.gnu.org/licenses/gpl-2.0.html + * Version: 1.0.1 + * Requires PHP: 5.3 + * Author: Imagify Support Team + * Author URI: http://imagify.io/ + * License: GPLv2 + * License URI: http://www.gnu.org/licenses/gpl-2.0.html * - * Copyright SAS WP MEDIA 2018 + * Copyright 2020 WP Media + * + * @package WP-Media\ImagifyPluginHelpers\ResetOptimizationStatus */ -namespace ImagifyPlugin\Helpers\optimization\status; -defined( 'ABSPATH' ) or die(); +namespace ImagifyPluginHelpers\Optimization\ResetOptimizationStatus; + +defined( 'ABSPATH' ) || die(); add_filter( 'init', __NAMESPACE__ . '\reset' ); /** * “Reset” Imagify so that images uploaded to the Media library via FTP can be optimised. * + * @since 1.0 * @author Grégory Viguier * @author Caspar Hübinger - * - * @return void */ function reset() { - $deleted1 = delete_metadata( 'post', '', '_imagify_status', '', true ); $deleted2 = delete_metadata( 'post', '', '_imagify_optimization_level', '', true ); $deleted3 = delete_metadata( 'post', '', '_imagify_data', '', true ); diff --git a/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.zip b/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.zip index ee087085b06a05cb6e36fbbfaef0873b080b68ea..65dcba4963291f3fa5ef0714043836ba5ffdcbdd 100644 GIT binary patch delta 1211 zcmdnM*Uc{*;LXe;!T=FgXq!mI1%_+UXu~~OK1nRc=1va*B>~-IC z{7LGh4Kph?&vdA3d3!{k?V|EkkE7eJ?7h2IQtfra`i&E06v|IT=RKOdWY<#3?89tI z0v@4XYh(Xj4ezhNKDBSs;lmt!ic@nvdG`pK`aMk5t@nz`d%$+?;-cp5w*r0TTa>RJ zXcbFM@;ZoA)FPn@JdF`Bc7xn?$;MooFA68 zIzIYnVEWF)_s`DvGnIW*Y}7v%);v1={71QWPfN)>zlVu6ubMYs3#~u(W$EsX@mr#_ zA3qRst&P8WUnQnB|B|`zWUl4=7RgAjkFSVZvOa9GW5og{=j*RaW6W~b_{==9?tt3T zX^%P0qjyFbU1~l*<(`C=Hv8nqCk z_t_A`_U!&Xy%n0ydY#j9C%2#F3%_CCP`_yJeXc1lHdr*OU#LwpwR*UHuIq(URf2B+ z&Q__X&Tap_!C1FSx6Ea7yt-7Ln_6M(r}QPu_xrsnw!h#~y``mg$9}EzfA-xycwUpm z_uDnA)2?xe&r+KvK9N2D$!o&|*2~wXNFSZMIkV4cms-w-!}pHANd5xMx9l8mIeFiJ zG7l)51b8zti7?~L$*_z)`8KPzC!rh-F$tEZk+UfRb~Z3~BNwS`3s9*W5O3VInNfzBMFeOl2ZJ(DkMAM=hZlhA z16dgu+@X3V>$7Xr12qK#H3R{1X$3a}BgMx#FLZu8h?I& zX8Zqrwd;#zU2flI%sK24CONf0k4xr2rlQd-y$51?7wQ)^>)#4=yx*c6dgumccw~HW zhneA$zpoh9d3sgs`JY*H^zq;IQ%^kp%g?<^HzAwx!QGg?30&%GhaT}o9OXXLXl9`t z8o4v#Y9iN>tc=8W}0y-z1rxYz&EF73jfyL$PnDS z%R-jn$+=AHjzv8&alVIKL@&mC=koD%xzh0JsfMYPv}Ln|=pieUK?C zHt~LW#LgJWdzbB3PnHRf(ti9v$aSM%mg(`mx=)>hww_D(+VI8YPjP)s9qaLkMTr|0 zXDMk$9!Q!`Cw&U^Vhc^Y&h zxUN61^6$w*-rK`&&2F=O74r70as54o%%qmc13mlgWBU{Ymu^qKyeE}kKeI;QtfK7f z_WLs*HLaf#dLV(w$Pnj=$RA7(P=dt?SaPJ6p6S|N3+_IVbPncZC;w z>b(LN9WD{S=lEGt{6)+Di9Sx+uRTltO6%_xG!K}5`drA1MjOtr@p@P6Rz*DGdHUbw zdz{{@001jwrxpMJ diff --git a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php index a43ecbb..5c2f44b 100644 --- a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php +++ b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php @@ -3,32 +3,46 @@ * Plugin Name: Bulk Optimize only for Super Admins (Multisite) * Description: Bumps up the default user capacity required for bulk-optimization to Super Admin on multisite. * Plugin URI: https://github.com/wp-media/imagify-helpers/tree/master/settings/imagify-capacity/ - * Author: Imagify Support Team - * Author URI: http://imagify.io/ - * License: GNU General Public License v2 or later - * License URI: http://www.gnu.org/licenses/gpl-2.0.html + * Version: 1.1 + * Requires PHP: 5.3 + * Author: Imagify Support Team + * Author URI: http://imagify.io/ + * License: GPLv2 + * License URI: http://www.gnu.org/licenses/gpl-2.0.html * - * Copyright SAS WP MEDIA 2018 + * Copyright 2020 WP Media + * + * @package WP-Media\ImagifyPluginHelpers\BulkOptimUserCapacity */ -// Namespaces must be declared before any other declaration. -namespace ImagifyPlugin\Helpers\settings\capacity; +namespace ImagifyPluginHelpers\Settings\BulkOptimUserCapacity; -// Standard plugin security, keep this line in place. -defined( 'ABSPATH' ) or die(); +defined( 'ABSPATH' ) || die(); + +add_action( 'imagify_loaded', __NAMESPACE__ . '\init' ); +/** + * Plugin init. + * + * @since 1.1 + * @author Grégory Viguier + */ +function init() { + if ( is_multisite() ) { + add_action( 'imagify_capacity', __NAMESPACE__ . '\multisite_bulk_optimize', 10, 2 ); + } +} /** * Bumps up capacity for bulk optimization to super admin on multisite. * + * @since 1.0 * @author Caspar Hübinger - * @see https://github.com/wp-media/imagify-plugin/blob/c5c004f79e39595098e7269baa704bfd06f727de/inc/functions/common.php#L4-L67 + * @see https://github.com/wp-media/imagify-plugin/blob/cd17020d26c12d24fbca59455e87255a3e6de2dc/classes/Context/AbstractContext.php#L275-L300 * - * @param string $capacity WordPress user capacity - * @param string $describer Contextual describer of context. Possible values are 'manage', 'bulk-optimize', 'manual-optimize', 'auto-optimize', and 'optimize-file'. - * @return string Imagify capacity according to context + * @param string $capacity WordPress user capacity. + * @param string $describer Contextual describer of context. Possible values are like 'manage', 'bulk-optimize', 'manual-optimize', 'auto-optimize'. + * @return string Imagify capacity according to context. */ function multisite_bulk_optimize( $capacity, $describer ) { - - return is_multisite() && 'bulk-optimize' === $describer ? 'manage_network_options' : $capacity; + return 'bulk-optimize' === $describer ? 'manage_network_options' : $capacity; } -add_action( 'imagify_capacity', __NAMESPACE__ . '\multisite_bulk_optimize', 10, 2 ); diff --git a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.zip b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.zip index 4f196823b8ea7d25cd35fc6c36bdf150b2a71170..f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(OCpWYfx7w!Z2gYMuWMq>=UA^3$`jI%daHA6 z>B1L!HEwIxDCu}C6wnCsXyUio#AmBw`(b(d=bK+1Pv!rc<=J^4ZogCRp4}U7AB$bP z^1;fLIk{T@!h=HtmhTb#GUsv&+q$~{T^Uo{CI;7c|A>#vW=olPMX;Oy(Zd3JS^p1L zpCl9+%#nFmQDV_)ACPT@gUi>tJSJK1 z)H$h@!vCRoU42E{KfND!53iNia7pN&m$7))ZwEbw{eR_`I4z2w|7E3PxYX56Z))Ct z%x!yG=yN$NQsw2W?A$kHjnRpRyOM5fd!1{(?e<+~`MQdGn@t%L5BpZG=hu(7n=9<+ z=eO%>{_UwPTz7+JFOxs{;_%0953}DdKR#LIiK+9aFSqm(XFKfXG(Wui Date: Tue, 14 Jan 2020 01:00:45 +0100 Subject: [PATCH 4/6] Fixed plugins header indentation --- .../imagify-bulk-buffer-size.php | 6 +++--- .../imagify-bulk-buffer-size.zip | Bin 1497 -> 1496 bytes .../imagify-no-auto-optimize-pdf.php | 6 +++--- .../imagify-no-auto-optimize-pdf.zip | Bin 1576 -> 1574 bytes .../imagify-reset-optimization-status.php | 6 +++--- .../imagify-reset-optimization-status.zip | Bin 1931 -> 1929 bytes .../imagify-capacity-bulk-optimize.php | 6 +++--- .../imagify-capacity-bulk-optimize.zip | Bin 1744 -> 1743 bytes 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php index 3e07dc5..2b31651 100644 --- a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php +++ b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php @@ -1,8 +1,8 @@ Bht``8- z10w0qXDtVh~-5s;e~E*Z;PIfbHXWLv|HruQw_y#4|#jx;TUay3cb@+S+;i zo7U^t&AZiFF3Df{e?hu_&E{>)ZQJbDyqWnu?cO=*`hQW+mWsc7Q?Y@0;tC_Zh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yL!C&gEDbwqQxb<;MJLJTq8lD@*K>43PN0dxEXUNpCe4ohe&>+?|zR9B^2* zw?!;1pnlV_Z^`w4|7ZtS@tWJLws@77cPgVtD((FK=U3L8+j=b{jKN^-O{s0Wt~Yh& z9M)ou6fORB^~G7i76-=fqFH@v4W7JFk8TOb#UJ_R@Ikd{zgBI65o3LzBff_0z7U0dw2Fe=DKo|wg1DPx! F9sruHaWen_ diff --git a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php index 4e77610..f55f448 100644 --- a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php +++ b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php @@ -1,8 +1,8 @@ #8qE-)7bR_z-oZR#>uN0 zJ?jI3N`inGM3+`@GcdAzWn^Fgo0J5n=QKF2lC9R`@JzAEv+(Ql-?TQiq;f#zd^2b-BE&H9n##qu7K{xLI@XX5rnn7pGXQf46#3 z_i39oZZ*#W^H-;Rm{Z2T&stW_nZGP**6OU~57$qTvzY6C{N)=iJp)$*?bZSg&RGs8 z53$TndT(EKs^;wFRIiI}*Y&Tuv0JydZ%DN%kejTC;#gEb|zrLWno|l@MdHZ zVTPsm$=g_*kQ4l5X4YJ`rLSb-mcE+I$R;cfQOm)=!2rqtaC0UvU=26KlK}#}S=m6j Qg&7F5fVpBB&|(G#044fyQvd(} delta 842 zcmZ3+vx0{wz?+#xgaHJ)m?!d>aEttviBke%AU)ALmPzva!de#^Hk%=n?Vh~+g!Og(P@|BT+0c=`saA4kL2Z6tR{)SVvRM!ew^FC5v+H^rI zXeDo8^eKPU?BxEpqH*sx#hJ52b!Hc^ygLw|f5>x2taYd6*>D@{_itx^PmA9hHuF={ z-&+1}iSxoW^%IV<^gZ<1FhyN^NBhhc&(tUN51Nf)KIES%h;&dgJ>!3Gs#tkb>XMzC zz8cP{>;0s4?9x1^L&d+QXJ{rg?(t}hREiW%*5jv}IFfXkST9FiBE~$P8fLw6yYa#EFCUR%}{+ zOw~_$>kr-)cvt>_|1Wd&z9agg*UOf?tl`oBE56NRT1t@lTIucUw3aS0E9mvf**#0~ zj);lN;=|7`-K{#OtmBol;@lGon~m#o9=C|s}=vs$8cmfmC1HhfF^4Ypb7q=}o$rK27N=`?|W@FV@@E&%fq&@7$8JcaQod3K@LZ z(==_dip8PL6TbD?9F(t$>*3Tlc;{ID>06fF&Us~t{O{f?KD%*yak1EO#kD-F?z+9+ z3wyO<+(nI&Bc^cb_-yA-w3r<;N9gj$Oo=A`ySEoz^;#Kp{@@0FWrc5FCuQ$Z-g4W; z(Moy3`8Qklm#unI=K8i?Z-;-_^Ph3{|GbvQ9pv@b?%P#ccIJdU@8#q7xo=gJU#nO* zlOe)m=HYiyDRX~rUH3xr#8#m<&WDP+;x1jj;2pQ8YmqpEr-Fo?h_0smZ=LbJq?QU}C<~i%7 zDC5|r7P86Y;j$aQ`{xGc46l-ooO9oa`qvvgSh4y&^c#!*x!c#~RL!l;|h1DX^^o8ppr@0N@97 A*8l(j diff --git a/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php b/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php index 82d3f0b..d731971 100644 --- a/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php +++ b/optimization/imagify-reset-optimization-status/imagify-reset-optimization-status.php @@ -1,8 +1,8 @@ q$dU>F)e+yamz(Ukt}w-0I(t;v4NF= z!JR>YVX^_c;$(ex?fM9y@<<>C(WMpK42&#a85tPBruGKk&bs3vP`hp4A|~!+>Hd`d zliiay%(R$p_(Ulu|4)*DZBTE>lBMrTwx`WF!ua1U;XCsu{>szye|T@(wNx_uFq@Kq zM`)>E_y(SeUS4@ByEMXjlS$ae1HqUQ2jfxh!wl&>CW z6<)Vh?u$%rp2u&E=5-!kJ9huQU2)>>TYKqgyKk=-yE5S*8{31=F|7d{>dy{6VvIP- z_|QQ*W>VJLn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<-{ZE`(W_@YB^Xk3Ym7H_9PK%T< zcycSBVGH~7_jxMU&Wt_xtq(`UO%yD=ek}vRVC>5?`)NN z>fH9<8;o_Ubjw^O$E!=_xv3Sleo9}me81nTV*3j&)mvI>ckI_X|7YLbgXc9_e7{|@ zI_(;l_$;+);uG2PpS(6qV7+{8iuBRBn=|`%spY6`IDGH;i{vk|0p9E!Z#jA2JZFMr zkN|H+CJ|;>#+uB`=FWx4S(DGQ$xbe03j^k^$tT$qc|o}gu6gozwnRfb*($)Bl?{{? QnSrnlnAg4ovm*lo0DZ8l7ytkO diff --git a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php index 5c2f44b..df2ff94 100644 --- a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php +++ b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php @@ -1,8 +1,8 @@ d!Cmkz?+#xgaHJ~*(dUtaTl@3#w2 z4{xtF&SE#tHs1Waa^r^0HYLhat3I!pt|Wd&ShM?R$;H`;P8G*COI`Gyxp9SU^EEEX z*{MPG&gZqO?gUnu`hVoT<0!aiRfY77Iey;~Uc3`I7?_vtb-lA7tWlIX#VdM;FvS~E}5OtyN(s= z3SX`6Q$A_h#>A1Wy*_*5b>}zMe3C96Phwy6^sQH4Jo_?V&Y|=353rV*znoJjw_(Kw z)}>dfSUZzsD$}K#9u$>)?0j`>eiK8?3mXni9mhBO4ax<}W-siWaAf<=E6QQ9XFLCW z)()#;ELS?m`l@JOX1(6&XQ~e6!gUtXNnEi4Y7teF4m~}1ENWfv>T8=~lUR<5v3wO% zc*^(d_5<qmUQL?+Cdb#j_uE~d;|I?)0a(?_fThQ^o?C-+~Zy!Y0_u2LD(MVkO z;eCW>_x&~IT)kJ9r2Kt1Ynjzh1PDiy3ZnSWv0tmo_d zcCYK2?jP=vS-O6X>ISY=nl7g7Gc=N2W+>F8div!vT;}MkaCx!B=Mvw=rKPv>BPACo zJJpCOExf7~u<=qxv95I3+Vz!w(=I!0)L8VfOJ~>Pw%f(4{~ZpwJJs#>+k@Wkud&4O zFtD?;zrAue?V7`)x!SRf+L=}xwmaQdKm3n1z?+@p?yqeDBFw=2wD})%7$Z|T`{XcI z7Zaq6hn}4RycwB9m_-;kfDn`+;RZ}T#~RIzln*DHuvsxNuuOi)syNw>MRW2lHUTzw IR#5&00CY*O*8l(j delta 998 zcmX@ldx4iHz?+#xgaHJ)m?!d>af|$wi8BIXAU)AnN|=FJF90kHB;wc@7#tZCCO>3# zuNU|u6BiA{AiA`In}Lz#DcCLKG{WL4CgJtPKwX3gx9=*OH`P~-pg{!Zg@=txKJ(n%=Z9>zQ6Ko6Zzf3nf zud#`1-pZu4uDiAf@EumHnRht#sL$tLbFB6yYEG(s@TUGc@4s0OKhN6s+Dp(+Kt8i; zbDLThzm5N-6dp-|GPgKWmG^#yuPT@DD^C2r(7d+Lbbg)1`-66O?lFnqxWByoSmlvP zUZPJfeGpCUDtxlnxnt4x%csLd%&SFRA2`2{@<`M?`qDNvJZ*pOEe_9$+Y9Z|zh=a} zw%;GL^!f+SB}*ON*8hs0a!ItD^VjbWhi?mWzi2kN=r$>(jKA7?99wqCZ= zQtX7N;Di5WYYS@F3zt1oc(_Bo7OCmK49XcmM2hUIeCk-$(Fe9Q!JTn z1CLp&DMjV-nriiKyRymk>d#xno19kfmX^$o@x0u8((Jb;=QsTTZ+4ECe?kmInSr@!^IzsLMy4+2$)T(+ zCP>*1JwF9_Gct)Vi!g8iAt*b-4VZkEHJTeKBThDEvtnXonf!oNaq Date: Tue, 14 Jan 2020 01:12:00 +0100 Subject: [PATCH 5/6] Adapted README.md to the new namespace conventions --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8c856c6..5315b93 100644 --- a/README.md +++ b/README.md @@ -97,29 +97,33 @@ In this GitHub repository, plugins that address the same feature (cache, lazyloa It’s easy to over-engineer naming conventions, so we stick to a pragmatic rule of thumb when in doubt: -1. Namespaces should be unique and consistent. +1. Namespaces should be unique and consistent, and written in CamelCase. 2. Function names should be descriptive. We rely on one consistent namespace for all Helper Plugins, and descriptive subnamespaces for each plugin: ```php -namespace ImagifyPlugin\Helpers\{subnamespace(s)} +namespace ImagifyPluginHelpers\{subnamespace(s)} ``` Or more specifically: ```php -namespace ImagifyPlugin\Helpers\{feature}\{what_this_plugin_does} +namespace ImagifyPluginHelpers\{feature}\{what_this_plugin_does} ``` Example: ```php -namespace ImagifyPlugin\Helpers\optimization\auto; +namespace ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; +add_action( 'init', __NAMESPACE__ . '\exclude_pdf' ); + +/** + * Function doc. + */ function exclude_pdf() { // Exclude PDF files from being auto-optimized upon upload. } -add_action( 'init', __NAMESPACE__ . '\exclude_pdf' ); ``` ### 4.2. Naming placeholder URLs, domains, values @@ -144,4 +148,4 @@ All plugins in this repository, like WordPress and Imagify, are licensed under [ ## 6. Questions? -Shoot us a message at: [imagify.io/contact/](https://imagify.io/contact/) +Shoot us a message at: [imagify.io/contact/](https://imagify.io/contact/). From d36d893eaac9650e3e55e336d54a09ed30b70e45 Mon Sep 17 00:00:00 2001 From: Git I Hate You Date: Wed, 15 Jan 2020 18:10:36 +0100 Subject: [PATCH 6/6] =?UTF-8?q?Applied=20Tonya=E2=80=99s=20suggestions=20-?= =?UTF-8?q?=20Added=20vendor=20to=20namespaces=20-=20Removed=20`@package`?= =?UTF-8?q?=20tags=20since=20they=20are=20redundent=20with=20namespaces.?= =?UTF-8?q?=20Also=20added=20the=20related=20phpcs=20exclusion=20in=20phpc?= =?UTF-8?q?s.xml.=20-=20Fixed=20`CamelCase`=20=3D>=20`PascalCase`=20in=20g?= =?UTF-8?q?eneral=20README.=20-=20Removed=20useless=20priority=20+=20numbe?= =?UTF-8?q?r=20of=20args=20in=20a=20filter=20in=20"Change=20Bulk=20Buffer?= =?UTF-8?q?=20Size"=20helper.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 ++++---- .../imagify-helper-plugin.php | 7 ++----- .../imagify-bulk-buffer-size.php | 8 +++----- .../imagify-bulk-buffer-size.zip | Bin 1496 -> 1480 bytes .../imagify-no-auto-optimize-pdf.php | 10 +++------- .../imagify-no-auto-optimize-pdf.zip | Bin 1574 -> 1553 bytes .../imagify-reset-optimization-status.php | 6 ++---- .../imagify-reset-optimization-status.zip | Bin 1929 -> 1914 bytes phpcs.xml | 1 + .../imagify-capacity-bulk-optimize.php | 6 ++---- .../imagify-capacity-bulk-optimize.zip | Bin 1743 -> 1732 bytes 11 files changed, 17 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 5315b93..84c41a7 100644 --- a/README.md +++ b/README.md @@ -97,24 +97,24 @@ In this GitHub repository, plugins that address the same feature (cache, lazyloa It’s easy to over-engineer naming conventions, so we stick to a pragmatic rule of thumb when in doubt: -1. Namespaces should be unique and consistent, and written in CamelCase. +1. Namespaces should be unique and consistent, and written in PascalCase. 2. Function names should be descriptive. We rely on one consistent namespace for all Helper Plugins, and descriptive subnamespaces for each plugin: ```php -namespace ImagifyPluginHelpers\{subnamespace(s)} +namespace WPMedia\ImagifyPluginHelpers\{subnamespace(s)} ``` Or more specifically: ```php -namespace ImagifyPluginHelpers\{feature}\{what_this_plugin_does} +namespace WPMedia\ImagifyPluginHelpers\{feature}\{what_this_plugin_does} ``` Example: ```php -namespace ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; +namespace WPMedia\ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; add_action( 'init', __NAMESPACE__ . '\exclude_pdf' ); diff --git a/_imagify-helper-plugin/imagify-helper-plugin.php b/_imagify-helper-plugin/imagify-helper-plugin.php index 0870c85..8633213 100644 --- a/_imagify-helper-plugin/imagify-helper-plugin.php +++ b/_imagify-helper-plugin/imagify-helper-plugin.php @@ -11,16 +11,14 @@ * License URI: http://www.gnu.org/licenses/gpl-2.0.html * * Copyright 2020 WP Media - * - * @package WP-Media\ImagifyPluginHelpers\Boilerplate */ // EDIT THIS: Replace `boilerplate` with your custom subnamespace. // Namespaces must be declared before any other declaration. -namespace ImagifyPluginHelpers\Boilerplate; +namespace WPMedia\ImagifyPluginHelpers\Boilerplate\Example; // Standard plugin security, keep this line in place. -defined( 'ABSPATH' ) || die(); +defined( 'ABSPATH' ) || exit; // Hooking into `imagify_loaded` is a safe way to make sure all Imagify features are available, however, it’s not required. // Using other hooks directly will be just fine in most cases. @@ -36,5 +34,4 @@ function do_stuff() { // Do something here. add_filter( 'example_filter', 'example_function' ); - } diff --git a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php index 2b31651..822a19f 100644 --- a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php +++ b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.php @@ -11,15 +11,13 @@ * License URI: http://www.gnu.org/licenses/gpl-2.0.html * * Copyright 2020 WP Media - * - * @package WP-Media\ImagifyPluginHelpers\BulkBufferSize */ -namespace ImagifyPluginHelpers\Optimization\BulkBufferSize; +namespace WPMedia\ImagifyPluginHelpers\Optimization\BulkBufferSize; -defined( 'ABSPATH' ) || die(); +defined( 'ABSPATH' ) || exit; -add_filter( 'imagify_bulk_buffer_sizes', __NAMESPACE__ . '\buffer_sizes', 10, 3 ); +add_filter( 'imagify_bulk_buffer_sizes', __NAMESPACE__ . '\buffer_sizes' ); /** * Allow only one optimization at the same time during bulk optimization, for all contexts. * diff --git a/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.zip b/optimization/imagify-bulk-buffer-size/imagify-bulk-buffer-size.zip index 8099262b21411b5d8d141cbbe553ebb546b1dfd5..54b695f3cc995dada9efd6818dd98e69a397cb7f 100644 GIT binary patch delta 852 zcmcb?eS(`ez?+#xgaHJcC+JV))i>&Mm5-YY#2~t~f}4Sn;x^thtyXNg#Q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@Pd99b;TYoO(P;j5;WS&>89@>`cm){88_0{o**`E()X4kFMA9x2VlyUuUdRHwS z%b6#CMCxbRMlO36TnD;QtPM*Mgg&COOC#SR6awDbq z$?I8UctMF9q2mUNKQ~h92C10r$12Ah!ptx^ky!_7nuu6{H!B+`OE3dr6fnnRuz+{~ D>MvvS diff --git a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php index f55f448..ac13c19 100644 --- a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php +++ b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.php @@ -11,13 +11,11 @@ * License URI: http://www.gnu.org/licenses/gpl-2.0.html * * Copyright 2020 WP Media - * - * @package WP-Media\ImagifyPluginHelpers\NoAutoOptimPDF */ -namespace ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; +namespace WPMedia\ImagifyPluginHelpers\Optimization\NoAutoOptimPDF; -defined( 'ABSPATH' ) || die(); +defined( 'ABSPATH' ) || exit; add_filter( 'imagify_auto_optimize_attachment', __NAMESPACE__ . '\no_optimize_pdf', 10, 2 ); /** @@ -36,7 +34,5 @@ function no_optimize_pdf( $optimize, $attachment_id ) { return false; } - $mime_type = get_post_mime_type( $attachment_id ); - - return 'application/pdf' !== $mime_type; + return 'application/pdf' !== get_post_mime_type( $attachment_id ); } diff --git a/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.zip b/optimization/imagify-no-auto-optimize-pdf/imagify-no-auto-optimize-pdf.zip index ee49c642a39ab4d4b3897ed5df4de31ecd079b51..cacf2127aa1b1707f4bb4c0e231a275a73139640 100644 GIT binary patch delta 805 zcmZ3+Gm(ckz?+#xgaHJcC+JV)HRkSfm5-YZ#6WtZcQ7NbXTN>`SRP0uPF~IES-;9f zK28*<0z{Wqa5FHnd}U-{0GpB<9P4-6L7?u~atW0sEgBo0SM5`A&E=Y+;F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zZFus2`gF}Fi$1o!=Si;gHsgv);%Dz~iNARE=hUAc*M{`e`=@$mwCxN&SR^^4{_hXF z<;!?>szhz^l?$_uNi65LbGNP+(YTmc$l|}?_nEAcL+h=(7fk)C)bnTdSHDwM{NEGP zqrODtbgJ$5H@VZ}^GN9FdXN74`B$FTE$S@GVBB3$A3E=6?e6CJ$sDuZtSOn+z30%G z(=5s-t>- + diff --git a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php index df2ff94..b1d598b 100644 --- a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php +++ b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.php @@ -11,13 +11,11 @@ * License URI: http://www.gnu.org/licenses/gpl-2.0.html * * Copyright 2020 WP Media - * - * @package WP-Media\ImagifyPluginHelpers\BulkOptimUserCapacity */ -namespace ImagifyPluginHelpers\Settings\BulkOptimUserCapacity; +namespace WPMedia\ImagifyPluginHelpers\Settings\BulkOptimUserCapacity; -defined( 'ABSPATH' ) || die(); +defined( 'ABSPATH' ) || exit; add_action( 'imagify_loaded', __NAMESPACE__ . '\init' ); /** diff --git a/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.zip b/settings/imagify-capacity-bulk-optimize/imagify-capacity-bulk-optimize.zip index 518c5752db425be7012c678dc9add729d97b95be..32364f8ca922a4fe3c7c14fca5484cc61bf33b55 100644 GIT binary patch delta 959 zcmX@ldxV!az?+#xgaHJcC+JV)HRbMem5dtNKEFUKdR0gCco>8oCbKrJW^%V?hGSh0^rx2N4{b0=#sYVyn@?e75!F0bApy=aHs5SQ(`xE?kGIP!QHy7{!PbIokwYm zT>C|15@W*nRwnv~@y=Y!=(g>)Ap40~b$Q(%&OYbA!k2dJ$*&Wih4Ru|U$_~4epab} zc!qI*y3WJPuK8`6S1->C?1($I#qnvTNn5vzz9X;g`ENT^D@^pHDt*zRz`i zXX&dN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