10% wp-criticalcss

Code Review | WP Critical CSS

WordPress plugin WP Critical CSS scored 10% from 54 tests.

About plugin

  • Plugin page: wp-criticalcss
  • Plugin version: 0.7.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2
  • WordPress version: 5.9.2
  • First release: Jan 2, 2017
  • Latest release: Nov 6, 2019
  • Number of updates: 460
  • Update frequency: every 2.3 days
  • Top authors: pcfreak30 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active / 21,881 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Installer.php+75
    Undefined variable: version_0_7_1

Server metrics [RAM: ▲1.22MB] [CPU: ▼262.93ms] Passed 4 tests

Analyzing server-side resources used by WP Critical CSS
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.68169.01 ▲144.27
Dashboard /wp-admin4.68 ▲1.26247.89 ▲214.16
Posts /wp-admin/edit.php4.90 ▲1.2657.56 ▲14.28
Add New Post /wp-admin/post-new.php8.13 ▲1.15100.72 ▼1,225.45
Media Library /wp-admin/upload.php4.52 ▲1.2241.30 ▲15.20
WP Critical CSS /wp-admin/options-general.php?page=wp_criticalcss4.5653.02

Server storage [IO: ▲0.28MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 89 new files
Database: 4 new tables, 4 new options
New tables
wp_wp_criticalcss_api_queue
wp_wp_criticalcss_processed_items
wp_wp_criticalcss_template_log
wp_wp_criticalcss_web_check_queue
New WordPress options
wp_criticalcss
wp_criticalcss_api_queue
wp_criticalcss_log
wp_criticalcss_web_check_queue

Browser metrics Passed 4 tests

A check of browser resources used by WP Critical CSS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,019 ▲29717.84 ▲2.445.71 ▲0.253.41 ▲0.87
Dashboard /wp-admin3,115 ▲2578.30 ▲2.16162.14 ▲24.12179.39 ▲12.51
Posts /wp-admin/edit.php2,943 ▲2525.52 ▲2.1591.39 ▲24.06140.62 ▼18.19
Add New Post /wp-admin/post-new.php1,724 ▲6321.56 ▲5.78459.86 ▲30.84192.63 ▲33.04
Media Library /wp-admin/upload.php1,728 ▲305.68 ▲0.21120.04 ▼24.42225.15 ▲18.70
WP Critical CSS /wp-admin/options-general.php?page=wp_criticalcss2,1425.1883.48126.65

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_wp_criticalcss_template_log
    • wp_wp_criticalcss_api_queue
    • wp_wp_criticalcss_web_check_queue
    • wp_wp_criticalcss_processed_items
  • Zombie WordPress options were found after uninstall: 4 options
    • wp_criticalcss_web_check_queue
    • wp_criticalcss_api_queue
    • wp_criticalcss_log
    • wp_criticalcss

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 50× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP\\CriticalCSS\\Queue\\ListTableAbstract' not found in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Queue/Web/Check/Table.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP\\CriticalCSS\\Integration\\IntegrationAbstract' not found in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Integration/WebP.php:7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Queue/ListTableAbstract.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'ComposePress\\Core\\Abstracts\\Component' not found in wp-content/plugins/wp-criticalcss/vendor/composepress/core/src/Abstracts/Plugin.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'pcfreak30\\WordPress\\Plugin\\Framework\\ComponentAbstract' not found in wp-content/plugins/wp-criticalcss/vendor/pcfreak30/wordpress-plugin-framework/src/ManagerAbstract.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'ComposePress\\Core\\ComponentInterface' not found in wp-content/plugins/wp-criticalcss/vendor/composepress/core/src/Abstracts/Component.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WP\\CriticalCSS\\Queue\\ListTableAbstract' not found in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Queue/Log/Table.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP\\CriticalCSS\\Integration\\IntegrationAbstract' not found in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/Integration/RocketAsyncCSS.php:8
    • > PHP Warning
      require_once(wp-content/plugins/wp-criticalcss/vendor/pcfreak30/wordpress-cache-store/vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/wp-criticalcss/vendor/pcfreak30/wordpress-cache-store/tests/bootstrap.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'WP\\CriticalCSS\\Background\\ProcessAbstract' not found in wp-content/plugins/wp-criticalcss/lib/WP/CriticalCSS/API/Background/Process.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: above the fold, critical css, optimize

wp-criticalcss/wp-criticalcss.php Passed 13 tests

The entry point to "WP Critical CSS" version 0.7.7 is a PHP file that has certain tags in its header comment area
91 characters long description:
Use CriticalCSS.com web service to automatically create the required CSS for above the fold

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected5,530 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PHP711,1722,0795,201
JSON800329

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces26
Interfaces2
Traits2
Classes57
▷ Abstract classes1119.30%
▷ Concrete classes4680.70%
▷ Final classes00.00%
Methods407
▷ Static methods30.74%
▷ Public methods32279.12%
▷ Protected methods6916.95%
▷ Private methods163.93%
Functions21
▷ Named functions1047.62%
▷ Anonymous functions1152.38%
Constants34
▷ Global constants1441.18%
▷ Class constants2058.82%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin