78% advanced-custom-css

Code Review | Advanced Custom CSS

WordPress plugin Advanced Custom CSS scored 78% from 54 tests.

About plugin

  • Plugin page: advanced-custom-css
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.1
  • WordPress version: 5.9.2
  • First release: Jun 11, 2017
  • Latest release: Jun 6, 2020
  • Number of updates: 10
  • Update frequency: every 109.1 days
  • Top authors: prasadkirpekar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,024 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼299.47ms] Passed 4 tests

An overview of server-side resources used by Advanced Custom CSS
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0155.77 ▼0.66
Dashboard /wp-admin3.42 ▲0.0232.69 ▼1.58
Posts /wp-admin/edit.php3.65 ▲0.0136.92 ▼9.06
Add New Post /wp-admin/post-new.php6.89 ▼0.0892.35 ▼1,186.56
Media Library /wp-admin/upload.php3.30 ▲0.0123.23 ▼0.33
Advanced Custom CSS /wp-admin/themes.php?page=advanced-custom-css3.7327.72

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 3 new options
New WordPress options
acc_css_pages
acc_css_posts
acc_css_everywhere

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom CSS
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,793 ▲3916.19 ▲0.156.43 ▲0.032.30 ▼0.76
Dashboard /wp-admin2,897 ▲396.22 ▲0.04131.45 ▼5.76165.44 ▲11.55
Posts /wp-admin/edit.php2,693 ▼13.25 ▲0.0063.57 ▲1.14140.50 ▼5.10
Add New Post /wp-admin/post-new.php1,664 ▲316.33 ▼0.05411.19 ▼20.31162.44 ▲9.66
Media Library /wp-admin/upload.php1,703 ▲25.55 ▲0.02140.10 ▼6.38190.03 ▼5.75
Advanced Custom CSS /wp-admin/themes.php?page=advanced-custom-css3,7483.9688.04202.88

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • acc_css_posts
    • acc_css_everywhere
    • acc_css_pages

Smoke tests 50% 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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=advanced-custom-css
    • > Notice in wp-content/plugins/advanced-custom-css/admin/acc-options.php+41
    Undefined variable: action_url
    • > GET request to /wp-admin/themes.php?page=advanced-custom-css
    • > Deprecated in wp-content/plugins/advanced-custom-css/include/csstidy/class.csstidy_optimise.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; csstidy_optimise has a deprecated constructor

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
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/advanced-custom-css/admin/acc-options.php:28
    • > PHP Fatal error
      require(): Failed opening required 'lang.inc.php' (include_path='.:/usr/share/php') in wp-content/plugins/advanced-custom-css/include/csstidy/css_optimiser.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/advanced-custom-css/advanced-custom-css.php:104
    • > PHP Notice
      Undefined variable: action_url in wp-content/plugins/advanced-custom-css/admin/acc-options.php on line 27
    • > PHP Warning
      require(lang.inc.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-custom-css/include/csstidy/css_optimiser.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% 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:
  • Donate link: Please fix this invalid url: ""
The official readme.txt is a good inspiration

advanced-custom-css/advanced-custom-css.php Passed 13 tests

The main PHP script in "Advanced Custom CSS" version 1.1.0 is automatically included on every request by WordPress
57 characters long description:
Add Custom CSS to your WordPress site. Easy and Flexible.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin10,746 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript49959598,284
PHP72847382,155
CSS44943307

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 134)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity130.67
▷ Minimum class complexity45.00
▷ Maximum class complexity186.00
Average method complexity9.84
▷ Minimum method complexity1.00
▷ Maximum method complexity134.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin