78% advanced-custom-css

Code Review | Advanced Custom CSS

WordPress plugin Advanced Custom CSS scored78%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: 6.3.1
  • 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,277 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.78ms] Passed 4 tests

An overview of server-side resources used by Advanced Custom CSS
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.29 ▼9.63
Dashboard /wp-admin3.33 ▲0.0349.64 ▼1.16
Posts /wp-admin/edit.php3.38 ▲0.0347.56 ▼9.73
Add New Post /wp-admin/post-new.php5.91 ▲0.0390.93 ▼2.59
Media Library /wp-admin/upload.php3.26 ▲0.0337.56 ▲2.12
Advanced Custom CSS /wp-admin/themes.php?page=advanced-custom-css3.4034.18

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
acc_css_posts
acc_css_everywhere
widget_recent-comments
widget_theysaidso_widget
acc_css_pages

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Custom CSS
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,846 ▲6014.52 ▼0.161.96 ▼0.2746.98 ▲1.56
Dashboard /wp-admin2,222 ▲194.87 ▼0.01102.05 ▼30.9036.25 ▼12.76
Posts /wp-admin/edit.php2,101 ▼22.03 ▼0.0036.19 ▼7.9131.73 ▼13.53
Add New Post /wp-admin/post-new.php1,549 ▲423.27 ▲0.07583.85 ▼99.0858.91 ▼19.54
Media Library /wp-admin/upload.php1,404 ▲44.18 ▼0.06100.38 ▼15.4745.94 ▼7.24
Advanced Custom CSS /wp-admin/themes.php?page=advanced-custom-css1,1362.9970.8387.09

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • acc_css_everywhere
    • acc_css_posts
    • widget_recent-posts
    • acc_css_pages
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 115 occurences, only the last one shown
    • > 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+702
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/themes.php?page=advanced-custom-css
    • > Deprecated in wp-content/plugins/advanced-custom-css/include/csstidy/class.csstidy.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; csstidy has a deprecated constructor
    • > GET request to /wp-admin/themes.php?page=advanced-custom-css
    • > Deprecated in wp-content/plugins/advanced-custom-css/include/csstidy/class.csstidy_print.php+39
    Methods with the same name as their class will not be constructors in a future version of PHP; csstidy_print has a deprecated constructor
    • > 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
  • 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

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 take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > 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 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
    • > PHP Notice
      Undefined variable: action_url in wp-content/plugins/advanced-custom-css/admin/acc-options.php on line 27
    • > 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

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 97% 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
Attributes that require attention:
  • Donate link: Invalid url: "- https://paypal.me/prasadkirpekar"
The official readme.txt might help

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

The main file in "Advanced Custom CSS" v. 1.1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected10,746 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript49959598,284
PHP72847382,155
CSS44943307

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Method cyclomatic complexity has to 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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin