78% clearfy

Code Review | Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer

WordPress plugin Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer scored78%from 54 tests.

About plugin

  • Plugin page: clearfy
  • Plugin version: 2.2.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 7, 2017
  • Latest release: Nov 23, 2023
  • Number of updates: 98
  • Update frequency: every 23.1 days
  • Top authors: alexkovalevv (53.06%)webcraftic (36.73%)webtemyk (9.18%)studiopioneer (3.06%)creativemotion (2.04%)

Code review

54 tests

User reviews

325 reviews

Install metrics

80,000+ active /2,004,617 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲4.72MB] [CPU: ▲41.97ms] Passed 4 tests

Analyzing server-side resources used by Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.63 ▲3.1668.39 ▲26.73
Dashboard /wp-admin8.61 ▲5.26363.83 ▲300.83
Posts /wp-admin/edit.php8.64 ▲5.27100.57 ▲55.22
Add New Post /wp-admin/post-new.php11.11 ▲5.22141.08 ▲44.55
Media Library /wp-admin/upload.php8.46 ▲5.2377.99 ▲41.38

Server storage [IO: ▲5.66MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • The plugin illegally modified 4 files (1.16KB) outside of "wp-content/plugins/clearfy/" and "wp-content/uploads/"
    • (new file) wp-content/cache/wmac/index.html
    • (new file) wp-content/cache/wmac/css/index.html
    • (new file) wp-content/cache/wmac/js/index.html
    • (new file) wp-content/cache/wmac/.htaccess
Filesystem: 753 new files
Database: no new tables, 13 new options
New WordPress options
wbcr_clearfy_deactivated_unused_modules
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
wbcr_clearfy_plugin_activated
wbcr_clearfy_robots_txt_text_cache
widget_theysaidso_widget
wbcr_clearfy_plugin_version
can_compress_scripts
wbcr_clearfy_last_check_update
...

Browser metrics Passed 4 tests

Checking browser requirements for Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,881 ▼86610.78 ▼3.941.56 ▼0.1430.91 ▼13.15
Dashboard /wp-admin2,589 ▲4155.75 ▲0.07108.39 ▲11.3448.31 ▲2.94
Posts /wp-admin/edit.php2,497 ▲3972.41 ▲0.4149.42 ▲13.1137.50 ▲3.14
Add New Post /wp-admin/post-new.php1,866 ▲33123.22 ▲0.19611.13 ▲5.9233.51 ▼12.93
Media Library /wp-admin/upload.php1,781 ▲3814.39 ▲0.2296.91 ▲2.8343.41 ▼0.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 13 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • wbcr_clearfy_last_check_update
    • wbcr_clearfy_last_check_update_time
    • widget_recent-posts
    • wbcr_clearfy_plugin_activated
    • wbcr_clearfy_plugin_version
    • wbcr_clearfy_deactive_preinstall_components
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/clearfy/components/assets-manager/views/conditions-logic-editor-template.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/part-assets-manager-info-bar.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/part-assets-manager-tabs-menu.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/assets-manager.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/part-assets-manager-header.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/part-tab-content-assets-plugins-settings.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/tab-content-assets-plugins.php
    • > /wp-content/plugins/clearfy/components/assets-manager/views/tab-content-assets.php
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/clearfy/components/cache/admin/boot.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_Factory473_Update' not found in wp-content/plugins/clearfy/components/updates-manager/migrations/010008.php:7
    • > PHP Warning
      Use of undefined constant WCACHE_PLUGIN_DIR - assumed 'WCACHE_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/clearfy/components/cache/includes/cache.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_FactoryForms469_FontControl' not found in wp-content/plugins/clearfy/libs/factory/forms/controls/google-font.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step_Custom' not found in wp-content/plugins/clearfy/admin/pages/setup/steps/class-step-optimize-images.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Wbcr_Factory473_Update' not found in wp-content/plugins/clearfy/components/assets-manager/migrations/010108.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step_Custom' not found in wp-content/plugins/clearfy/admin/pages/setup/steps/class-step-congratulation.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step' not found in wp-content/plugins/clearfy/libs/factory/templates/pages/setup-parts/class-step-form.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WBCR\\Factory_Templates_126\\Pages\\Step_Custom' not found in wp-content/plugins/clearfy/admin/pages/setup/steps/class-step-plugins.php:11
    • > PHP Warning
      require_once(WCACHE_PLUGIN_DIR/includes/helpers.php): failed to open stream: No such file or directory in wp-content/plugins/clearfy/components/cache/includes/cache.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 65 tag instead of maximum 10
You can take inspiration from this readme.txt

clearfy/clearfy.php Passed 13 tests

The main PHP file in "Clearfy Cache – WordPress optimization plugin, Minify HTML, CSS & JS, Defer" ver. 2.2.0 adds more information about the plugin and also serves as the entry point for this plugin
132 characters long description:
Disables unused Wordpress features, improves performance and increases SEO rankings, using Clearfy, which makes WordPress very easy.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin67,320 lines of code in 513 files:
LanguageFilesBlank linesComment linesLines of code
PHP3489,58819,90536,102
PO File393,1484,13511,428
CSS523586057,795
JavaScript421,1597825,199
LESS261,0143124,934
JSON1001,810
SVG32049
Markdown1102
HTML1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity19.24
▷ Minimum class complexity1.00
▷ Maximum class complexity245.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces20
Interfaces2
Traits1
Classes268
▷ Abstract classes228.21%
▷ Concrete classes24691.79%
▷ Final classes31.22%
Methods1,912
▷ Static methods23312.19%
▷ Public methods1,42274.37%
▷ Protected methods25313.23%
▷ Private methods23712.40%
Functions185
▷ Named functions7037.84%
▷ Anonymous functions11562.16%
Constants264
▷ Global constants22685.61%
▷ Class constants3814.39%
▷ Public constants38100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
42 PNG files occupy 0.71MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/rio-icon-128x128.png52.63KB20.79KB▼ 60.50%
admin/assets/img/trial-license-chip.png1.95KB0.73KB▼ 62.77%
admin/assets/img/bind-key.png4.16KB2.33KB▼ 43.98%
admin/assets/img/upm-icon-128x128.png19.97KB7.34KB▼ 63.25%
admin/assets/img/robin-image-optimizer-fake-board.png13.40KB6.27KB▼ 53.17%