88% css-adder-by-agence-press

Code Review | CSS Adder By Agence-Press

WordPress plugin CSS Adder By Agence-Press scored 88% from 54 tests.

About plugin

  • Plugin page: css-adder-by-agen...
  • Plugin version: 1.5.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5
  • WordPress version: 5.8.1
  • First release: Apr 13, 2016
  • Latest release: Jul 4, 2016
  • Number of updates: 9
  • Update frequency: every 9.7 days
  • Top authors: agencepress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 1,258 total downloads

Benchmarks

Plugin footprint Passed 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.02MB] [CPU: ▼132.10ms] Passed 4 tests

A check of server-side resources used by CSS Adder By Agence-Press
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1438.73 ▲14.39
Dashboard /wp-admin3.08 ▲0.0353.67 ▲13.80
Posts /wp-admin/edit.php3.13 ▲0.0342.07 ▼1.83
Add New Post /wp-admin/post-new.php5.44 ▲0.01104.08 ▼544.83
Media Library /wp-admin/upload.php3.03 ▲0.0234.16 ▲4.46
CSS-Adder /wp-admin/options-general.php?page=cssadder_page_options2.9926.86

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 142 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

CSS Adder By Agence-Press: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.84 ▲0.209.63 ▼1.1848.36 ▼2.62
Dashboard /wp-admin2,975 ▲415.96 ▲0.01143.80 ▲3.76114.04 ▼3.94
Posts /wp-admin/edit.php2,744 ▲52.72 ▼0.0074.30 ▲3.09104.95 ▲18.42
Add New Post /wp-admin/post-new.php1,538 ▲4018.41 ▼0.41394.36 ▲20.45116.07 ▲9.92
Media Library /wp-admin/upload.php1,809 ▲55.06 ▼0.01150.53 ▼1.13112.43 ▲0.92
CSS-Adder /wp-admin/options-general.php?page=cssadder_page_options1,1142.0852.7469.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/css_optimiser.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Text_Diff_Renderer' not found in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests/class.Text_Diff_Renderer_parallel.php:7
    • > PHP Warning
      require_once(Text/Diff.php): failed to open stream: No such file or directory in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests.php on line 22
    • > PHP Fatal error
      Uncaught Error: Class 'Text_Diff_Renderer' not found in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests/class.Text_Diff_Renderer_parallel.php:7
    • > PHP Notice
      Undefined index: HTTP_ACCEPT in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/css_optimiser.php on line 133
    • > PHP Fatal error
      require_once(): Failed opening required 'Text/Diff.php' (include_path='.:/usr/share/php') in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests.php on line 22
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/css_optimiser.php on line 139
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/class.csstidy.php on line 886
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/class.csstidy.php on line 886
    • > PHP Fatal error
      Uncaught Error: Class 'HTMLReporter' not found in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests/class.csstidy_reporter.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Text_Diff_Renderer' not found in wp-content/plugins/css-adder-by-agence-press/csstidy-1.5.2/testing/unit-tests/class.Text_Diff_Renderer_parallel.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: post, css adder, agence press, adder, page...

css-adder-by-agence-press/css-adder.php 92% from 13 tests

Analyzing the main PHP file in "CSS Adder By Agence-Press" version 1.5.0
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("css-adder-by-agence-press.php" instead of "css-adder.php")

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
Success! There were no dangerous files found in this plugin10,598 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
HTML1836707,241
PHP144001,0993,045
CSS3604281
JSON11016
Pascal131715

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity72.00
▷ Minimum class complexity1.00
▷ Maximum class complexity255.00
Average method complexity9.00
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods71
▷ Static methods11.41%
▷ Public methods71100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
csstidy-1.5.2/Docs/media/empty.png0.20KB0.09KB▼ 53.88%
csstidy-1.5.2/Docs/media/background.png0.23KB0.10KB▼ 58.82%