84% wp-conditional-content

Code Review | WordPress Conditional Content

WordPress plugin WordPress Conditional Content scored84%from 54 tests.

About plugin

  • Plugin page: wp-conditional-co...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Dec 2, 2013
  • Latest release: Dec 2, 2013
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: superinteractive (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /5,619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.82ms] Passed 4 tests

Server-side resources used by WordPress Conditional Content
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.07 ▼0.78
Dashboard /wp-admin3.32 ▲0.0245.34 ▼5.01
Posts /wp-admin/edit.php3.37 ▲0.0243.29 ▼3.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.40 ▼22.49
Media Library /wp-admin/upload.php3.24 ▲0.0236.69 ▲3.59

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

WordPress Conditional Content: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.19 ▼1.191.88 ▲0.1343.77 ▲4.44
Dashboard /wp-admin2,209 ▲185.85 ▲0.74100.53 ▼3.3938.20 ▼6.07
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0635.68 ▼1.4434.87 ▼1.06
Add New Post /wp-admin/post-new.php1,538 ▲1523.24 ▲0.08689.96 ▲38.1167.64 ▲16.88
Media Library /wp-admin/upload.php1,388 ▼34.17 ▼0.0397.73 ▼1.3744.09 ▲1.04

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wp-conditional-content/classes/class-core.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: content, if, conditional, shortcodes, statements...

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

The main PHP file in "WordPress Conditional Content" ver. 0.1 adds more information about the plugin and also serves as the entry point for this plugin
76 characters long description:
Use shortcodes to display content only when specified paramaters are matched

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected80 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2588080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity27.00
▷ Minimum class complexity27.00
▷ Maximum class complexity27.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods228.57%
▷ Protected methods00.00%
▷ Private methods571.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected