84% conditional-content

Code Review | Conditional Content

WordPress plugin Conditional Content scored84%from 54 tests.

About plugin

  • Plugin page: conditional-content
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.6
  • WordPress version: 6.3.1
  • First release: May 12, 2017
  • Latest release: Nov 30, 2020
  • Number of updates: 24
  • Update frequency: every 54.1 days
  • Top authors: extremeidea (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

30+ active /6,179 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.90MB] [CPU: ▲6.51ms] Passed 4 tests

This is a short check of server-side resources used by Conditional Content
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.39 ▲0.9359.20 ▲10.65
Dashboard /wp-admin4.21 ▲0.9054.14 ▲0.46
Posts /wp-admin/edit.php4.26 ▲0.9060.56 ▲10.05
Add New Post /wp-admin/post-new.php6.79 ▲0.90101.70 ▲9.98
Media Library /wp-admin/upload.php4.13 ▲0.9041.97 ▲5.53
Conditional Content /wp-admin/options-general.php?page=ConditionalContent4.0437.91

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 180 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_conditional_content_widget
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Conditional Content
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.42 ▲0.012.01 ▲0.2945.98 ▲1.93
Dashboard /wp-admin2,199 ▲195.64 ▼0.0292.54 ▲2.1543.98 ▲1.34
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0444.74 ▲6.5037.38 ▼0.04
Add New Post /wp-admin/post-new.php1,529 ▲123.27 ▼0.08665.09 ▼9.9755.97 ▼5.02
Media Library /wp-admin/upload.php1,407 ▲74.20 ▲0.0797.03 ▼6.6843.44 ▲0.57
Conditional Content /wp-admin/options-general.php?page=ConditionalContent1,8975.35114.1480.50

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 101× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\JsonGuard\\Constraints\\ParentSchemaAwareContainerInstanceConstraint' not found in wp-content/plugins/conditional-content/vendor/league/json-guard/src/Constraints/AdditionalProperties.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'com\\extremeidea\\php\\tools\\log4php\\LoggerPatternConverter' not found in wp-content/plugins/conditional-content/vendor/com.extremeidea.php/log4php/pattern/LoggerPatternConverterMDC.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\JsonGuard\\Loader' not found in wp-content/plugins/conditional-content/vendor/league/json-guard/src/Loaders/FileLoader.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'com\\extremeidea\\php\\tools\\log4php\\LoggerAppenderDailyFile' not found in wp-content/plugins/conditional-content/classes/core/LoggerAppenderDailyFile.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'com\\extremeidea\\php\\tools\\log4php\\LoggerPatternConverter' not found in wp-content/plugins/conditional-content/vendor/com.extremeidea.php/log4php/pattern/LoggerPatternConverterLevel.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'com\\extremeidea\\php\\tools\\log4php\\LoggerConfigurable' not found in wp-content/plugins/conditional-content/vendor/com.extremeidea.php/log4php/LoggerAppender.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'com\\extremeidea\\php\\tools\\log4php\\LoggerPatternConverter' not found in wp-content/plugins/conditional-content/vendor/com.extremeidea.php/log4php/pattern/LoggerPatternConverterLocation.php:31
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\JsonGuard\\Constraints\\ContainerInstanceConstraint' not found in wp-content/plugins/conditional-content/vendor/league/json-guard/src/Constraints/Items.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\JsonGuard\\Constraints\\ParentSchemaAwarePropertyConstraint' not found in wp-content/plugins/conditional-content/vendor/league/json-guard/src/Constraints/Max.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'League\\JsonGuard\\Constraints\\Constraint' not found in wp-content/plugins/conditional-content/vendor/league/json-guard/src/Constraints/PropertyConstraint.php:9

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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

conditional-content/conditional-content.php Passed 13 tests

The principal PHP file in "Conditional Content" v. 1.0.1 is loaded by WordPress automatically on each request
85 characters long description:
Plugin helps you to insert conditional content on the WordPress pages/posts/sidebars.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin8,516 lines of code in 174 files:
LanguageFilesBlank linesComment linesLines of code
PHP1581,9677,2367,625
JavaScript21720355
Markdown61330250
JSON100138
DTD1255469
XML3131958
YAML13011
CSS12109
HTML1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.56
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces12
Interfaces12
Traits0
Classes138
▷ Abstract classes64.35%
▷ Concrete classes13295.65%
▷ Final classes00.00%
Methods689
▷ Static methods12017.42%
▷ Public methods55880.99%
▷ Protected methods365.22%
▷ Private methods9513.79%
Functions28
▷ Named functions2071.43%
▷ Anonymous functions828.57%
Constants78
▷ Global constants00.00%
▷ Class constants78100.00%
▷ Public constants78100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected