@@ -349,7 +349,7 @@ |
||
349 | 349 | ? "<strong>" . $this->_sScriptName . "</strong>: " |
350 | 350 | : ''; |
351 | 351 | return $_sScripTitle |
352 | - . implode( '<br />', $_aWarnings ); |
|
352 | + . implode( '<br />', $_aWarnings ); |
|
353 | 353 | |
354 | 354 | } |
355 | 355 |
@@ -135,12 +135,12 @@ discard block |
||
135 | 135 | * </ul> |
136 | 136 | * @param string $sScriptName The script name. |
137 | 137 | */ |
138 | - public function __construct( array $aRequirements=array(), $sScriptName='' ) { |
|
138 | + public function __construct( array $aRequirements = array(), $sScriptName = '' ) { |
|
139 | 139 | |
140 | 140 | // Avoid undefined index warnings. |
141 | 141 | $aRequirements = $aRequirements + $this->_aDefaultRequirements; |
142 | 142 | $aRequirements = array_filter( $aRequirements, 'is_array' ); |
143 | - foreach( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
143 | + foreach ( array( 'php', 'mysql', 'wordpress' ) as $_iIndex => $_sName ) { |
|
144 | 144 | if ( isset( $aRequirements[ $_sName ] ) ) { |
145 | 145 | $aRequirements[ $_sName ] = $aRequirements[ $_sName ] + $this->_aDefaultRequirements[ $_sName ]; |
146 | 146 | } |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | $_aWarnings = array(); |
166 | 166 | |
167 | 167 | // PHP, WordPress, MySQL |
168 | - $_aWarnings[] = $this->_getWarningByType( 'php' ); |
|
169 | - $_aWarnings[] = $this->_getWarningByType( 'wordpress' ); |
|
170 | - $_aWarnings[] = $this->_getWarningByType( 'mysql' ); |
|
168 | + $_aWarnings[ ] = $this->_getWarningByType( 'php' ); |
|
169 | + $_aWarnings[ ] = $this->_getWarningByType( 'wordpress' ); |
|
170 | + $_aWarnings[ ] = $this->_getWarningByType( 'mysql' ); |
|
171 | 171 | |
172 | 172 | // Ensure necessary array elements. |
173 | 173 | $this->_aRequirements = $this->_aRequirements + array( |
@@ -180,10 +180,10 @@ discard block |
||
180 | 180 | // Check the rest. |
181 | 181 | $_aWarnings = array_merge( |
182 | 182 | $_aWarnings, |
183 | - $this->_checkFunctions( $this->_aRequirements['functions'] ), |
|
184 | - $this->_checkClasses( $this->_aRequirements['classes'] ), |
|
185 | - $this->_checkConstants( $this->_aRequirements['constants'] ), |
|
186 | - $this->_checkFiles( $this->_aRequirements['files'] ) |
|
183 | + $this->_checkFunctions( $this->_aRequirements[ 'functions' ] ), |
|
184 | + $this->_checkClasses( $this->_aRequirements[ 'classes' ] ), |
|
185 | + $this->_checkConstants( $this->_aRequirements[ 'constants' ] ), |
|
186 | + $this->_checkFiles( $this->_aRequirements[ 'files' ] ) |
|
187 | 187 | ); |
188 | 188 | |
189 | 189 | $this->aWarnings = array_filter( $_aWarnings ); // drop empty elements. |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | * @return string The warning. |
198 | 198 | */ |
199 | 199 | private function _getWarningByType( $sType ) { |
200 | - if ( ! isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
200 | + if ( !isset( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
|
201 | 201 | return ''; |
202 | 202 | } |
203 | 203 | if ( $this->_checkPHPVersion( $this->_aRequirements[ $sType ][ 'version' ] ) ) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @internal |
227 | 227 | */ |
228 | 228 | private function _checkWordPressVersion( $sWordPressVersion ) { |
229 | - return version_compare( $GLOBALS['wp_version'], $sWordPressVersion, ">=" ); |
|
229 | + return version_compare( $GLOBALS[ 'wp_version' ], $sWordPressVersion, ">=" ); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /** |
@@ -298,9 +298,9 @@ discard block |
||
298 | 298 | */ |
299 | 299 | private function _getWarningsByFunctionName( $sFuncName, $aSubjects ) { |
300 | 300 | $_aWarnings = array(); |
301 | - foreach( $aSubjects as $_sSubject => $_sWarning ) { |
|
302 | - if ( ! call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
303 | - $_aWarnings[] = sprintf( $_sWarning, $_sSubject ); |
|
301 | + foreach ( $aSubjects as $_sSubject => $_sWarning ) { |
|
302 | + if ( !call_user_func_array( $sFuncName, array( $_sSubject ) ) ) { |
|
303 | + $_aWarnings[ ] = sprintf( $_sWarning, $_sSubject ); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | return $_aWarnings; |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | */ |
323 | 323 | public function _replyToPrintAdminNotices() { |
324 | 324 | |
325 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
325 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
326 | 326 | if ( empty( $_aWarnings ) ) { |
327 | 327 | return; |
328 | 328 | } |
@@ -341,12 +341,12 @@ discard block |
||
341 | 341 | */ |
342 | 342 | private function _getWarnings() { |
343 | 343 | |
344 | - $_aWarnings = array_unique( $this->aWarnings ); |
|
344 | + $_aWarnings = array_unique( $this->aWarnings ); |
|
345 | 345 | if ( empty( $_aWarnings ) ) { |
346 | 346 | return ''; |
347 | 347 | } |
348 | - $_sScripTitle = $this->_sScriptName |
|
349 | - ? "<strong>" . $this->_sScriptName . "</strong>: " |
|
348 | + $_sScripTitle = $this->_sScriptName |
|
349 | + ? "<strong>".$this->_sScriptName."</strong>: " |
|
350 | 350 | : ''; |
351 | 351 | return $_sScripTitle |
352 | 352 | . implode( '<br />', $_aWarnings ); |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | * @param boolean $bIsOnActivation Whether it is called upon plugin activation hook. |
362 | 362 | * @return void |
363 | 363 | */ |
364 | - public function deactivatePlugin( $sPluginFilePath, $sMessage='', $bIsOnActivation=false ) { |
|
364 | + public function deactivatePlugin( $sPluginFilePath, $sMessage = '', $bIsOnActivation = false ) { |
|
365 | 365 | |
366 | 366 | add_action( 'admin_notices', array( $this, '_replyToPrintAdminNotices' ) ); |
367 | - $this->aWarnings[] = '<strong>' . $sMessage . '</strong>'; |
|
368 | - if ( ! function_exists( 'deactivate_plugins' ) ) { |
|
369 | - if ( ! @include( ABSPATH . 'wp-admin/includes/plugin.php' ) ) { |
|
367 | + $this->aWarnings[ ] = '<strong>'.$sMessage.'</strong>'; |
|
368 | + if ( !function_exists( 'deactivate_plugins' ) ) { |
|
369 | + if ( !@include( ABSPATH.'wp-admin/includes/plugin.php' ) ) { |
|
370 | 370 | return; |
371 | 371 | } |
372 | 372 | } |
@@ -376,8 +376,8 @@ discard block |
||
376 | 376 | // Before that, we can display messages to the user. |
377 | 377 | if ( $bIsOnActivation ) { |
378 | 378 | |
379 | - $_sPluginListingPage = add_query_arg( array(), $GLOBALS['pagenow'] ); |
|
380 | - wp_die( $this->_getWarnings() . "<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
379 | + $_sPluginListingPage = add_query_arg( array(), $GLOBALS[ 'pagenow' ] ); |
|
380 | + wp_die( $this->_getWarnings()."<p><a href='$_sPluginListingPage'>Go back</a>.</p>" ); |
|
381 | 381 | |
382 | 382 | } |
383 | 383 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @since 3.5.0 |
97 | 97 | * @since 3.6.0 Made it accept string content to be passed to the first parameter. |
98 | 98 | */ |
99 | - public function __construct( $sFilePathOrContent='', array $aReplacements=array(), array $aCallbacks=array() ) { |
|
99 | + public function __construct( $sFilePathOrContent = '', array $aReplacements = array(), array $aCallbacks = array() ) { |
|
100 | 100 | |
101 | 101 | $this->sText = file_exists( $sFilePathOrContent ) |
102 | 102 | ? file_get_contents( $sFilePathOrContent ) |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | '/^[\s]*==[\s]*(.+?)[\s]*==/m', |
133 | 133 | $sText, |
134 | 134 | -1, |
135 | - PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
135 | + PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY |
|
136 | 136 | ); |
137 | 137 | return $_aSections; |
138 | 138 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @since 3.5.0 |
144 | 144 | * @return string |
145 | 145 | */ |
146 | - public function get( $sSectionName='' ) { |
|
146 | + public function get( $sSectionName = '' ) { |
|
147 | 147 | return $sSectionName |
148 | 148 | ? $this->getSection( $sSectionName ) |
149 | 149 | : $this->_getParsedText( $this->sText ); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function _replyToReplaceCodeBlocks( $aMatches ) { |
207 | 207 | |
208 | - if ( ! isset( $aMatches[ 1 ] ) ) { |
|
208 | + if ( !isset( $aMatches[ 1 ] ) ) { |
|
209 | 209 | return $aMatches[ 0 ]; |
210 | 210 | } |
211 | 211 | |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | */ |
229 | 229 | public function getRawSection( $sSectionName ) { |
230 | 230 | |
231 | - $_iIndex = array_search( $sSectionName, $this->_aSections ); |
|
231 | + $_iIndex = array_search( $sSectionName, $this->_aSections ); |
|
232 | 232 | return false === $_iIndex |
233 | 233 | ? '' |
234 | 234 | : trim( $this->_aSections[ $_iIndex + 1 ] ); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | // If <?php notation is missing, highlight_string() will not highlight the syntax so add it. |
249 | 249 | $_bHasPHPTag = "<?php" === substr( $sCode, 0, 5 ); |
250 | 250 | |
251 | - $sCode = $_bHasPHPTag ? $sCode : "<?php " . $sCode; |
|
251 | + $sCode = $_bHasPHPTag ? $sCode : "<?php ".$sCode; |
|
252 | 252 | |
253 | 253 | $sCode = str_replace( '"', "'", $sCode ); // highlight_string() crashes if double quotes are contained in the code. |
254 | 254 | $sCode = highlight_string( $sCode, true ); |
@@ -213,7 +213,7 @@ |
||
213 | 213 | get_current_user_id(), |
214 | 214 | 'dismissed_wp_pointers', |
215 | 215 | true |
216 | - ) |
|
216 | + ) |
|
217 | 217 | ); |
218 | 218 | $_aValidPointers = array(); |
219 | 219 |
@@ -191,7 +191,8 @@ |
||
191 | 191 | if ( in_array( $_sScreenID, $this->aScreenIDs ) ) { |
192 | 192 | return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() ); |
193 | 193 | } |
194 | - if ( isset( $_GET[ 'page' ] ) ) { // sanitization unnecessary |
|
194 | + if ( isset( $_GET[ 'page' ] ) ) { |
|
195 | +// sanitization unnecessary |
|
195 | 196 | return apply_filters( get_class( $this ) . '-' . $this->getHTTPQueryGET( 'page' ), array() ); |
196 | 197 | } |
197 | 198 | return array(); |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | */ |
111 | 111 | private function ___setHooks( $aScreenIDs ) { |
112 | 112 | |
113 | - foreach( $aScreenIDs as $_sScreenID ) { |
|
114 | - if ( ! $_sScreenID ) { |
|
113 | + foreach ( $aScreenIDs as $_sScreenID ) { |
|
114 | + if ( !$_sScreenID ) { |
|
115 | 115 | continue; |
116 | 116 | } |
117 | - add_filter( get_class( $this ) . '-' . $_sScreenID, array( $this, '_replyToSetPointer' ) ); |
|
117 | + add_filter( get_class( $this ).'-'.$_sScreenID, array( $this, '_replyToSetPointer' ) ); |
|
118 | 118 | } |
119 | 119 | |
120 | - if ( ! $this->_hasBeenCalled() ) { |
|
120 | + if ( !$this->_hasBeenCalled() ) { |
|
121 | 121 | return; |
122 | 122 | } |
123 | 123 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | |
160 | 160 | $_aPointers = $this->_getValidPointers( $this->_getPointers() ); |
161 | 161 | |
162 | - if ( empty( $_aPointers ) || ! is_array( $_aPointers ) ) { |
|
162 | + if ( empty( $_aPointers ) || !is_array( $_aPointers ) ) { |
|
163 | 163 | return; |
164 | 164 | } |
165 | 165 | |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $_oScreen = get_current_screen(); |
180 | 180 | $_sScreenID = $_oScreen->id; |
181 | 181 | if ( in_array( $_sScreenID, $this->aScreenIDs ) ) { |
182 | - return apply_filters( get_class( $this ) . '-' . $_sScreenID, array() ); |
|
182 | + return apply_filters( get_class( $this ).'-'.$_sScreenID, array() ); |
|
183 | 183 | } |
184 | 184 | if ( isset( $_GET[ 'page' ] ) ) { // sanitization unnecessary |
185 | - return apply_filters( get_class( $this ) . '-' . $this->getHTTPQueryGET( 'page' ), array() ); |
|
185 | + return apply_filters( get_class( $this ).'-'.$this->getHTTPQueryGET( 'page' ), array() ); |
|
186 | 186 | } |
187 | 187 | return array(); |
188 | 188 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | private function _getValidPointers( $_aPointers ) { |
197 | 197 | |
198 | 198 | // Get dismissed pointers |
199 | - $_aDismissed = explode( |
|
199 | + $_aDismissed = explode( |
|
200 | 200 | ',', |
201 | 201 | ( string ) get_user_meta( |
202 | 202 | get_current_user_id(), |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $_aPointer[ 'pointer_id' ] = $_iPointerID; |
225 | 225 | |
226 | 226 | // Add the pointer to $_aValidPointers array |
227 | - $_aValidPointers[] = $_aPointer; |
|
227 | + $_aValidPointers[ ] = $_aPointer; |
|
228 | 228 | |
229 | 229 | } |
230 | 230 | return $_aValidPointers; |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | * @return string |
295 | 295 | * @internal |
296 | 296 | */ |
297 | - public function ___getInternalScript( $aPointers=array() ) { |
|
297 | + public function ___getInternalScript( $aPointers = array() ) { |
|
298 | 298 | |
299 | - $_aJSArray = json_encode( $aPointers ); |
|
299 | + $_aJSArray = json_encode( $aPointers ); |
|
300 | 300 | |
301 | 301 | /** |
302 | 302 | * Checks check-boxes in siblings. |
@@ -260,7 +260,7 @@ |
||
260 | 260 | in_array( |
261 | 261 | substr( $_sIterationItem, strrpos( $_sIterationItem, '/' ) + 1 ), |
262 | 262 | array( '.', '..' ) |
263 | - ) |
|
263 | + ) |
|
264 | 264 | ) { |
265 | 265 | return; |
266 | 266 | } |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @since 3.6.0 |
54 | 54 | */ |
55 | - public $aOptions = array( |
|
56 | - 'include_directory' => false, // (boolean) whether the contents should be put inside a root directory. |
|
55 | + public $aOptions = array( |
|
56 | + 'include_directory' => false, // (boolean) whether the contents should be put inside a root directory. |
|
57 | 57 | 'additional_source_directories' => array(), |
58 | 58 | // 'ignoring_file_extensions' => array(), // not implemented yet. |
59 | 59 | ); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @param array|boolean $abOptions |
67 | 67 | * @param callable[] $aCallbacks |
68 | 68 | */ |
69 | - public function __construct( $sSource, $sDestination, $abOptions=false, array $aCallbacks=array() ) { |
|
69 | + public function __construct( $sSource, $sDestination, $abOptions = false, array $aCallbacks = array() ) { |
|
70 | 70 | $this->sSource = $sSource; |
71 | 71 | $this->sDestination = $sDestination; |
72 | 72 | $this->aOptions = $this->___getFormattedOptions( $abOptions ); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | public function compress() { |
98 | 98 | |
99 | 99 | // Check whether it is possible to perform the task. |
100 | - if ( ! $this->___canZip( $this->sSource ) ) { |
|
100 | + if ( !$this->___canZip( $this->sSource ) ) { |
|
101 | 101 | return false; |
102 | 102 | } |
103 | 103 | |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | $_oZip = new ZipArchive(); |
110 | - if ( ! $_oZip->open( $this->sDestination, ZIPARCHIVE::CREATE ) ) { |
|
110 | + if ( !$_oZip->open( $this->sDestination, ZIPARCHIVE::CREATE ) ) { |
|
111 | 111 | return false; |
112 | 112 | } |
113 | 113 | |
114 | 114 | $this->sSource = $this->___getSanitizedSourcePath( $this->sSource ); |
115 | 115 | |
116 | - $_aCallbacks = array( |
|
116 | + $_aCallbacks = array( |
|
117 | 117 | 'unknown' => '__return_false', |
118 | 118 | 'directory' => array( $this, '_replyToCompressDirectory' ), |
119 | 119 | 'file' => array( $this, '_replyToCompressFile' ), |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @since 3.6.0 Changed the name from `_compressDirectory`. Changed the scope to public to allow overriding the method in an extended class. |
144 | 144 | * @return boolean True on success, false otherwise. |
145 | 145 | */ |
146 | - public function _replyToCompressDirectory( ZipArchive $oZip, $sSourceDirPath, array $aCallbacks=array(), $bIncludeDir=false, array $aAdditionalSourceDirs=array() ) { |
|
146 | + public function _replyToCompressDirectory( ZipArchive $oZip, $sSourceDirPath, array $aCallbacks = array(), $bIncludeDir = false, array $aAdditionalSourceDirs = array() ) { |
|
147 | 147 | |
148 | 148 | $_sArchiveRootDirName = ''; |
149 | 149 | |
@@ -172,11 +172,11 @@ discard block |
||
172 | 172 | /** |
173 | 173 | * @since 3.6.0 |
174 | 174 | */ |
175 | - private function ___addArchiveItems( $oZip, $aSourceDirPaths, $aCallbacks, $sRootDirName='' ) { |
|
175 | + private function ___addArchiveItems( $oZip, $aSourceDirPaths, $aCallbacks, $sRootDirName = '' ) { |
|
176 | 176 | |
177 | - $sRootDirName = $sRootDirName ? rtrim( $sRootDirName, '/' ) . '/' : ''; |
|
177 | + $sRootDirName = $sRootDirName ? rtrim( $sRootDirName, '/' ).'/' : ''; |
|
178 | 178 | |
179 | - foreach( $aSourceDirPaths as $_isIndexOrRelativeDirPath => $_sSourceDirPath ) { |
|
179 | + foreach ( $aSourceDirPaths as $_isIndexOrRelativeDirPath => $_sSourceDirPath ) { |
|
180 | 180 | |
181 | 181 | $_sSourceDirPath = $this->___getSanitizedSourcePath( $_sSourceDirPath ); |
182 | 182 | $_sInsideDirPrefix = is_integer( $_isIndexOrRelativeDirPath ) |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | : $_isIndexOrRelativeDirPath; |
185 | 185 | |
186 | 186 | // Add a directory inside the compressing directory. |
187 | - if( $_sInsideDirPrefix ) { |
|
187 | + if ( $_sInsideDirPrefix ) { |
|
188 | 188 | $this->___addRelativeDir( |
189 | 189 | $oZip, |
190 | 190 | $_sInsideDirPrefix, |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $_sSourceDirPath, |
203 | 203 | $_sIterationItem, |
204 | 204 | $aCallbacks, |
205 | - $sRootDirName . $_sInsideDirPrefix |
|
205 | + $sRootDirName.$_sInsideDirPrefix |
|
206 | 206 | ); |
207 | 207 | } |
208 | 208 | } |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | $sRelativeDirPath = str_replace( '\\', '/', $sRelativeDirPath ); |
216 | 216 | $_aPathPartsParse = array_filter( explode( '/', $sRelativeDirPath ) ); |
217 | 217 | $_aDirPath = array(); |
218 | - foreach( $_aPathPartsParse as $_sDirName ) { |
|
219 | - $_aDirPath[] = $_sDirName; |
|
218 | + foreach ( $_aPathPartsParse as $_sDirName ) { |
|
219 | + $_aDirPath[ ] = $_sDirName; |
|
220 | 220 | $this->___addEmptyDir( |
221 | 221 | $oZip, |
222 | 222 | implode( '/', $_aDirPath ), |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | * @param array $aCallbacks An array holding callbacks. |
235 | 235 | * @param string $sInsidePathPrefix The prefix to add to the inside archive directory structure. |
236 | 236 | */ |
237 | - private function ___addArchiveItem( ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks, $sInsidePathPrefix='' ) { |
|
237 | + private function ___addArchiveItem( ZipArchive $oZip, $sSource, $_sIterationItem, array $aCallbacks, $sInsidePathPrefix = '' ) { |
|
238 | 238 | |
239 | 239 | $_sIterationItem = str_replace( '\\', '/', $_sIterationItem ); |
240 | - $sInsidePathPrefix = rtrim( $sInsidePathPrefix, '/' ) . '/'; // add a trailing slash |
|
240 | + $sInsidePathPrefix = rtrim( $sInsidePathPrefix, '/' ).'/'; // add a trailing slash |
|
241 | 241 | |
242 | 242 | // Ignore "." and ".." folders |
243 | 243 | if ( |
@@ -255,18 +255,18 @@ discard block |
||
255 | 255 | if ( true === is_dir( $_sIterationItem ) ) { |
256 | 256 | $this->___addEmptyDir( |
257 | 257 | $oZip, |
258 | - $sInsidePathPrefix . str_replace( |
|
259 | - $sSource . '/', |
|
258 | + $sInsidePathPrefix.str_replace( |
|
259 | + $sSource.'/', |
|
260 | 260 | '', |
261 | - $_sIterationItem . '/' |
|
261 | + $_sIterationItem.'/' |
|
262 | 262 | ), |
263 | 263 | $aCallbacks[ 'directory_name' ] |
264 | 264 | ); |
265 | 265 | } else if ( true === is_file( $_sIterationItem ) ) { |
266 | 266 | $this->___addFromString( |
267 | 267 | $oZip, |
268 | - $sInsidePathPrefix . str_replace( |
|
269 | - $sSource . '/', |
|
268 | + $sInsidePathPrefix.str_replace( |
|
269 | + $sSource.'/', |
|
270 | 270 | '', |
271 | 271 | $_sIterationItem |
272 | 272 | ), |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | * @since 3.6.0 Changed the name from `_compressFile`. Changed the scope from `private` to allow overriding in an extended class. |
296 | 296 | * @return boolean True on success, false otherwise. |
297 | 297 | */ |
298 | - public function _replyToCompressFile( ZipArchive $oZip, $sSourceFilePath, $aCallbacks=null ) { |
|
298 | + public function _replyToCompressFile( ZipArchive $oZip, $sSourceFilePath, $aCallbacks = null ) { |
|
299 | 299 | $this->___addFromString( |
300 | 300 | $oZip, |
301 | 301 | basename( $sSourceFilePath ), |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | * @return boolean |
327 | 327 | */ |
328 | 328 | private function ___canZip( $sSource ) { |
329 | - if ( ! extension_loaded( 'zip' ) ) { |
|
329 | + if ( !extension_loaded( 'zip' ) ) { |
|
330 | 330 | return false; |
331 | 331 | } |
332 | 332 | return file_exists( $sSource ); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | private function ___addEmptyDir( ZipArchive $oZip, $sInsidePath, $oCallable ) { |
342 | 342 | $sInsidePath = $this->___getFilteredArchivePath( $sInsidePath, $oCallable ); |
343 | - if ( ! strlen( $sInsidePath ) ) { |
|
343 | + if ( !strlen( $sInsidePath ) ) { |
|
344 | 344 | return; |
345 | 345 | } |
346 | 346 | $oZip->addEmptyDir( ltrim( $sInsidePath, '/' ) ); |
@@ -352,10 +352,10 @@ discard block |
||
352 | 352 | * @sine 3.9.0 Added the `$sSourceFilePath` parameter. |
353 | 353 | * @remark If the path is empty, it will not process. |
354 | 354 | */ |
355 | - private function ___addFromString( ZipArchive $oZip, $sInsidePath, $sSourceContents='', array $aCallbacks=array(), $sSourceFilePath ) { |
|
355 | + private function ___addFromString( ZipArchive $oZip, $sInsidePath, $sSourceContents = '', array $aCallbacks = array(), $sSourceFilePath ) { |
|
356 | 356 | |
357 | 357 | $sInsidePath = $this->___getFilteredArchivePath( $sInsidePath, $aCallbacks[ 'file_name' ] ); |
358 | - if ( ! strlen( $sInsidePath ) ) { |
|
358 | + if ( !strlen( $sInsidePath ) ) { |
|
359 | 359 | return; |
360 | 360 | } |
361 | 361 | $oZip->addFromString( |
@@ -196,7 +196,6 @@ |
||
196 | 196 | * For common hooks throughout the other factory components, see [Base Factory](./package-AdminPageFramework.Common.Factory.html). |
197 | 197 | * |
198 | 198 | * <h3>Factory Specific Hooks</h3> |
199 | - |
|
200 | 199 | * <h4> Action Hooks</h4> |
201 | 200 | * <ul> |
202 | 201 | * <li>**load_{page slug}** – [2.1.0+] triggered when the framework's page is loaded before the header gets sent. This will not be triggered in the admin pages that are not registered by the framework. The first parameter: class object [3.1.2+].</li> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function replyToDoAction() { |
41 | 41 | AdminPageFramework_WPUtility::setTransient( |
42 | - AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX . 'devver', |
|
42 | + AdminPageFrameworkLoader_Registry::TRANSIENT_PREFIX.'devver', |
|
43 | 43 | $this->___getVersion(), // data - if an error occurs, an empty string will be given |
44 | 44 | 604800 // for one week |
45 | 45 | ); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $_oUtil = new AdminPageFramework_WPUtility; |
55 | 55 | $_aHeaders = $_oUtil->getScriptData( |
56 | 56 | $this->___getPageBody(), |
57 | - '', /// context |
|
57 | + '', /// context |
|
58 | 58 | array( 'version' => 'Version' ) |
59 | 59 | ); |
60 | 60 | return $_oUtil->getElement( |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ? $aTabDefinition[ 'tab_slug' ] |
50 | 50 | : ''; |
51 | 51 | |
52 | - if ( ! $this->sTabSlug ) { |
|
52 | + if ( !$this->sTabSlug ) { |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | if ( $aTabDefinition[ 'tab_slug' ] ) { |
74 | 74 | add_action( |
75 | - "load_{$sPageSlug}_{$aTabDefinition['tab_slug']}", |
|
75 | + "load_{$sPageSlug}_{$aTabDefinition[ 'tab_slug' ]}", |
|
76 | 76 | array( $this, 'replyToLoadTab' ) |
77 | 77 | ); |
78 | 78 | add_action( |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | public function __construct( $oFactory, array $aPageArguments ) { |
30 | 30 | |
31 | 31 | $this->oFactory = $oFactory; |
32 | - $this->sPageSlug = $aPageArguments['page_slug']; |
|
32 | + $this->sPageSlug = $aPageArguments[ 'page_slug' ]; |
|
33 | 33 | $this->_addPage( $aPageArguments ); |
34 | 34 | $this->construct( $oFactory ); |
35 | 35 | |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function replyToLoadResources( $oFactory ) { |
60 | 60 | |
61 | - $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/asset/css/' . $this->sPageSlug . '.css'; |
|
62 | - if ( ! file_exists( $_sCSSPath ) ) { |
|
61 | + $_sCSSPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/asset/css/'.$this->sPageSlug.'.css'; |
|
62 | + if ( !file_exists( $_sCSSPath ) ) { |
|
63 | 63 | return; |
64 | 64 | } |
65 | 65 | $this->oFactory->enqueueStyle( |
@@ -46,7 +46,7 @@ |
||
46 | 46 | return $_oTOC->get(); |
47 | 47 | } |
48 | 48 | return '' |
49 | - . $_sContent; |
|
49 | + . $_sContent; |
|
50 | 50 | |
51 | 51 | } |
52 | 52 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @since 3.5.3 |
23 | 23 | */ |
24 | - protected function _getReadmeContents( $sFilePath, $sTOCTitle, $asSections=array() ) { |
|
24 | + protected function _getReadmeContents( $sFilePath, $sTOCTitle, $asSections = array() ) { |
|
25 | 25 | |
26 | 26 | $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser( |
27 | 27 | $sFilePath, |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | ) |
35 | 35 | ); |
36 | 36 | $_sContent = ''; |
37 | - foreach( ( array ) $asSections as $_sSection ) { |
|
37 | + foreach ( ( array ) $asSections as $_sSection ) { |
|
38 | 38 | $_sContent .= $_oWPReadmeParser->getSection( $_sSection ); |
39 | 39 | } |
40 | 40 | if ( $sTOCTitle ) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * @since 3.6.1 |
67 | 67 | * @return string The generate HTML output. |
68 | 68 | */ |
69 | - public function _replyToProcessShortcode_embed( $aAttributes, $sURL, $sShortcode='' ) { |
|
69 | + public function _replyToProcessShortcode_embed( $aAttributes, $sURL, $sShortcode = '' ) { |
|
70 | 70 | |
71 | 71 | $sURL = isset( $aAttributes[ 'src' ] ) ? $aAttributes[ 'src' ] : $sURL; |
72 | 72 | $_sHTML = wp_oembed_get( $sURL ); |
@@ -108,27 +108,27 @@ discard block |
||
108 | 108 | * array( 'Second Heading' => 'Another text', ), |
109 | 109 | * ) |
110 | 110 | */ |
111 | - public function getContentsByHeader( $sContents, $iHeaderNumber=2 ) { |
|
111 | + public function getContentsByHeader( $sContents, $iHeaderNumber = 2 ) { |
|
112 | 112 | |
113 | 113 | $_aContents = array(); |
114 | 114 | $_aSplitContents = preg_split( |
115 | 115 | // '/^[\s]*==[\s]*(.+?)[\s]*==/m', |
116 | - '/(<h[' . $iHeaderNumber . ']*[^>]*>.*?<\/h[' . $iHeaderNumber . ']>)/i', |
|
116 | + '/(<h['.$iHeaderNumber.']*[^>]*>.*?<\/h['.$iHeaderNumber.']>)/i', |
|
117 | 117 | $sContents, |
118 | 118 | -1, |
119 | - PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY |
|
119 | + PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY |
|
120 | 120 | ); |
121 | 121 | |
122 | - foreach( $_aSplitContents as $_iIndex => $_sSplitContent ) { |
|
123 | - if ( ! preg_match( '/<h[' . $iHeaderNumber . ']*[^>]*>(.*?)<\/h[' . $iHeaderNumber . ']>/i', $_sSplitContent , $_aMatches ) ) { |
|
122 | + foreach ( $_aSplitContents as $_iIndex => $_sSplitContent ) { |
|
123 | + if ( !preg_match( '/<h['.$iHeaderNumber.']*[^>]*>(.*?)<\/h['.$iHeaderNumber.']>/i', $_sSplitContent, $_aMatches ) ) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | |
127 | - if ( ! isset( $_aMatches[ 1 ] ) ) { |
|
127 | + if ( !isset( $_aMatches[ 1 ] ) ) { |
|
128 | 128 | continue; |
129 | 129 | } |
130 | - if ( isset( $_aSplitContents[ $_iIndex + 1 ] ) ) { |
|
131 | - $_aContents[] = array( |
|
130 | + if ( isset( $_aSplitContents[ $_iIndex + 1 ] ) ) { |
|
131 | + $_aContents[ ] = array( |
|
132 | 132 | $_aMatches[ 1 ], |
133 | 133 | $_aSplitContents[ $_iIndex + 1 ] |
134 | 134 | ); |
@@ -127,7 +127,7 @@ |
||
127 | 127 | if ( ! isset( $_aMatches[ 1 ] ) ) { |
128 | 128 | continue; |
129 | 129 | } |
130 | - if ( isset( $_aSplitContents[ $_iIndex + 1 ] ) ) { |
|
130 | + if ( isset( $_aSplitContents[ $_iIndex + 1 ] ) ) { |
|
131 | 131 | $_aContents[] = array( |
132 | 132 | $_aMatches[ 1 ], |
133 | 133 | $_aSplitContents[ $_iIndex + 1 ] |