73% critical-css-for-wp

Code Review | Reduce Unused CSS Solution with Critical CSS For WP

WordPress plugin Reduce Unused CSS Solution with Critical CSS For WP scored73%from 54 tests.

About plugin

  • Plugin page: critical-css-for-wp
  • Plugin version: 1.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 15, 2022
  • Latest release: Nov 7, 2023
  • Number of updates: 49
  • Update frequency: every 8.6 days
  • Top authors: magazine3 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /17,326 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.34MB] [CPU: ▼4.34ms] Passed 4 tests

An overview of server-side resources used by Reduce Unused CSS Solution with Critical CSS For WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3738.47 ▼1.69
Dashboard /wp-admin3.64 ▲0.3048.01 ▼15.80
Posts /wp-admin/edit.php3.81 ▲0.4552.81 ▲2.51
Add New Post /wp-admin/post-new.php6.23 ▲0.3498.13 ▼0.92
Media Library /wp-admin/upload.php3.57 ▲0.3436.85 ▲1.06

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

How much does this plugin use your filesystem and database?
It is recommended to fix the following issues
  • Illegal file modification detected: 3 files (92.02KB) outside of "wp-content/plugins/critical-css-for-wp/" and "wp-content/uploads/"
    • (new file) wp-content/cache/critical-css-for-wp/css/0bba90111c2f173cff13aa7eb4f94889.css
    • (new file) wp-content/cache/critical-css-for-wp/css/d44c34cfed9d779feaaeb753fb76c2f0.css
    • (new file) wp-content/cache/critical-css-for-wp/css/553f6978a85cdddde528416e8ae02520.css
Filesystem: 482 new files
Database: 1 new table, 9 new options
New tables
wp_critical_css_for_wp_urls
New WordPress options
ccfwp_current_term
can_compress_scripts
ccfwp_current_post
widget_recent-comments
category_children
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Reduce Unused CSS Solution with Critical CSS For WP: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲6014.57 ▲0.331.99 ▲0.1342.87 ▲1.46
Dashboard /wp-admin2,214 ▲375.68 ▲0.0492.65 ▼3.8940.42 ▼2.88
Posts /wp-admin/edit.php2,113 ▲132.00 ▲0.0639.86 ▼1.4335.41 ▼2.27
Add New Post /wp-admin/post-new.php1,539 ▲423.65 ▲0.53622.30 ▼14.4951.63 ▼24.97
Media Library /wp-admin/upload.php1,410 ▲74.19 ▲0.03103.59 ▲6.1242.86 ▲1.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_critical_css_for_wp_urls
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-posts
    • widget_recent-comments
    • ccfwp_current_term
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • ccfwp_current_post
    • category_children

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
The following issues need your attention
  • 186× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\odeVisitor\\AbstractNodeVisitor' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\ameExpression' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Node/Expression/InlinePrint.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\Binary\\AbstractBinary' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Extension/DebugExtension.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Extension/SandboxExtension.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\ConditionalExpression' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/critical-css-for-wp/css-extractor/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes: Please take inspiration from this readme.txt

critical-css-for-wp/critical-css-for-wp.php 77% from 13 tests

"Reduce Unused CSS Solution with Critical CSS For WP" version 1.0.11's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 262 characters long)
  • Domain Path: The domain path folder does not exist ("/languages")

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
Success! There were no dangerous files found in this plugin23,509 lines of code in 468 files:
LanguageFilesBlank linesComment linesLines of code
PHP4444,8576,72321,644
JSON900778
JavaScript23014414
CSS2308374
YAML3560200
Markdown734089
reStructuredText18510

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity5.62
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces43
Interfaces20
Traits0
Classes404
▷ Abstract classes133.22%
▷ Concrete classes39196.78%
▷ Final classes5413.81%
Methods1,207
▷ Static methods927.62%
▷ Public methods1,05987.74%
▷ Protected methods615.05%
▷ Private methods877.21%
Functions217
▷ Named functions18886.64%
▷ Anonymous functions2913.36%
Constants82
▷ Global constants1923.17%
▷ Class constants6376.83%
▷ Public constants6298.41%

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