72% acss-purger

Code Review | ACSS Purger

WordPress plugin ACSS Purger scored72%from 54 tests.

About plugin

  • Plugin page: acss-purger
  • Plugin version: 1.0.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2023
  • Latest release: Jul 4, 2023
  • Number of updates: 7
  • Update frequency: every 11.9 days
  • Top authors: rosua (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,083 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.57MB] [CPU: ▲1.07ms] Passed 4 tests

A check of server-side resources used by ACSS Purger
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.00 ▲0.5444.66 ▲4.64
Dashboard /wp-admin3.93 ▲0.6353.91 ▲5.87
Posts /wp-admin/edit.php3.99 ▲0.6247.19 ▲2.23
Add New Post /wp-admin/post-new.php6.46 ▲0.5785.48 ▼6.93
Media Library /wp-admin/upload.php3.80 ▲0.5641.00 ▲4.33
ACSS Purger /wp-admin/admin.php?page=acss_purger3.8038.78

Server storage [IO: ▲1.59MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 235 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
acss_purger_notices
theysaidso_admin_options
can_compress_scripts
acss_purger_version
widget_recent-comments
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by ACSS Purger
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.331.77 ▲0.2046.19 ▲3.59
Dashboard /wp-admin2,198 ▲185.52 ▼0.1685.00 ▼0.4637.93 ▼1.80
Posts /wp-admin/edit.php2,103 ▼01.99 ▼0.0034.47 ▲0.4232.97 ▼1.77
Add New Post /wp-admin/post-new.php1,528 ▼523.31 ▲0.21672.07 ▼6.2850.58 ▼4.97
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.0893.44 ▼3.8241.68 ▼2.87
ACSS Purger /wp-admin/admin.php?page=acss_purger1,0218.45282.1397.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • acss_purger_version
    • acss_purger_notices
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=acss_purger
    • > Error in wp-content/plugins/acss-purger/src/Api/Setting/Cache.php+39
    Uncaught Error: Undefined constant 'ACSS_DYNAMIC_CSS_DIR' in wp-content/plugins/acss-purger/src/Api/Setting/Cache.php:39
    Stack trace:
    #0 wp-content/plugins/acss-purger/src/Api/Setting/Cache.php(32): Yabe\AcssPurger\Api\Setting\Cache->index()
    #1 wp-includes/rest-api/class-wp-rest-server.php(1188): Yabe\AcssPurger\Api\Setting\Cache->Yabe\AcssPurger\Api\Setting\{closure}()
    #2 wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request()
    #3 wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch()
    #4 wp-includes/rest-api.php(418): WP_REST_Server->serve_request()
    #5 wp-includes/class-wp-hook.php(310): rest_api_loaded()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(565): WP_Hook->do_action()
    #8 wp-includes/class-wp.php(398): do_action_re
    • > GET request to /wp-admin/admin.php?page=acss_purger
    • > Error in wp-content/plugins/acss-purger/src/Api/Setting/Option.php+38
    Uncaught Error: Class 'Automatic_CSS\Model\Config\Classes' not found in wp-content/plugins/acss-purger/src/Api/Setting/Option.php:38
    Stack trace:
    #0 wp-content/plugins/acss-purger/src/Api/Setting/Option.php(31): Yabe\AcssPurger\Api\Setting\Option->index()
    #1 wp-includes/rest-api/class-wp-rest-server.php(1188): Yabe\AcssPurger\Api\Setting\Option->Yabe\AcssPurger\Api\Setting\{closure}()
    #2 wp-includes/rest-api/class-wp-rest-server.php(1035): WP_REST_Server->respond_to_request()
    #3 wp-includes/rest-api/class-wp-rest-server.php(447): WP_REST_Server->dispatch()
    #4 wp-includes/rest-api.php(418): WP_REST_Server->serve_request()
    #5 wp-includes/class-wp-hook.php(310): rest_api_loaded()
    #6 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #7 wp-includes/plugin.php(565): WP_Hook->do_action()
    #8 wp-includes/class-wp.php(398

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 76× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface '_YabeAcssPurger\\Symfony\\Component\\PropertyAccess\\PropertyPathInterface' not found in wp-content/plugins/acss-purger/vendor/symfony/property-access/PropertyPath.php:23
    • > PHP Fatal error
      Uncaught Error: Class '_YabeAcssPurger\\Symfony\\Polyfill\\Intl\ormalizer\ormalizer' not found in wp-content/plugins/acss-purger/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Yabe\\AcssPurger\\Api\\AbstractApi' not found in wp-content/plugins/acss-purger/src/Api/Setting/Cache.php:21
    • > PHP Fatal error
      Uncaught Error: Class '_YabeAcssPurger\\Sabberworm\\CSS\\Value\\Value' not found in wp-content/plugins/acss-purger/vendor/sabberworm/php-css-parser/src/Value/PrimitiveValue.php:5
    • > PHP Fatal error
      Uncaught Error: Interface '_YabeAcssPurger\\Symfony\\Component\\PropertyInfo\\PropertyListExtractorInterface' not found in wp-content/plugins/acss-purger/vendor/symfony/property-info/Extractor/ReflectionExtractor.php:31
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/acss-purger/vendor/symfony/polyfill-mbstring/bootstrap80.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class '_YabeAcssPurger\\Sabberworm\\CSS\\Value\\CSSFunction' not found in wp-content/plugins/acss-purger/vendor/sabberworm/php-css-parser/src/Value/Color.php:9
    • > PHP Fatal error
      Uncaught Error: Class '_YabeAcssPurger\\Sabberworm\\CSS\\Property\\Selector' not found in wp-content/plugins/acss-purger/vendor/sabberworm/php-css-parser/src/Property/KeyframeSelector.php:5
    • > PHP Fatal error
      Uncaught Error: Interface '_YabeAcssPurger\\Symfony\\Component\\PropertyAccess\\Exception\\ExceptionInterface' not found in wp-content/plugins/acss-purger/vendor/symfony/property-access/Exception/OutOfBoundsException.php:18
    • > PHP Fatal error
      Uncaught Error: Interface '_YabeAcssPurger\\Symfony\\Component\\String\\Inflector\\InflectorInterface' not found in wp-content/plugins/acss-purger/vendor/symfony/string/Inflector/EnglishInflector.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=acss_purger
    • > Network (severe)
    index.php/wp-json/acss-purger/v1/setting/cache/index - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/admin.php?page=acss_purger
    • > Network (severe)
    index.php/wp-json/acss-purger/v1/setting/option/index - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: You can look at the official readme.txt

acss-purger/acss-purger.php 92% from 13 tests

"ACSS Purger" version 1.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin16,100 lines of code in 219 files:
LanguageFilesBlank linesComment linesLines of code
PHP1804416,41913,615
JSON14001,468
Markdown1727701,009
SVG6006
CSS11111
JavaScript1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity16.95
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces38
Interfaces21
Traits0
Classes130
▷ Abstract classes96.92%
▷ Concrete classes12193.08%
▷ Final classes2016.53%
Methods979
▷ Static methods16416.75%
▷ Public methods86087.84%
▷ Protected methods101.02%
▷ Private methods10911.13%
Functions173
▷ Named functions13175.72%
▷ Anonymous functions4224.28%
Constants164
▷ Global constants1710.37%
▷ Class constants14789.63%
▷ Public constants11980.95%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin