89% conditionally-display-featured-image-on-singular-pages

Code Review | Conditionally display featured image on singular posts and pages

WordPress plugin Conditionally display featured image on singular posts and pages scored89%from 54 tests.

About plugin

  • Plugin page: conditionally-dis...
  • Plugin version: 3.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 17, 2016
  • Latest release: Sep 16, 2023
  • Number of updates: 107
  • Update frequency: every 23.3 days
  • Top authors: cyrillbolliger (100%)

Code review

54 tests

User reviews

33 reviews

Install metrics

30,000+ active /275,668 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼3.77ms] Passed 4 tests

Server-side resources used by Conditionally display featured image on singular posts and pages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.02 ▼3.68
Dashboard /wp-admin3.35 ▲0.0445.14 ▼8.07
Posts /wp-admin/edit.php3.46 ▲0.1045.34 ▼5.22
Add New Post /wp-admin/post-new.php5.94 ▲0.0593.51 ▲1.88
Media Library /wp-admin/upload.php3.27 ▲0.0438.77 ▲7.00

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Conditionally display featured image on singular posts and pages
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.21 ▼1.161.90 ▲0.0740.89 ▼4.41
Dashboard /wp-admin2,206 ▲185.78 ▲0.9295.08 ▼6.8138.40 ▲0.05
Posts /wp-admin/edit.php2,089 ▼02.14 ▲0.0941.51 ▲1.4034.01 ▼2.82
Add New Post /wp-admin/post-new.php1,527 ▼1522.81 ▼0.07626.81 ▼41.3958.23 ▲3.82
Media Library /wp-admin/upload.php1,388 ▲64.17 ▼0.0393.94 ▼6.1841.29 ▲0.88

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
The SRP test was a success

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed: The official readme.txt might help

conditionally-display-featured-image-on-singular-pages/conditional-featured-image.php 92% from 13 tests

"Conditionally display featured image on singular posts and pages" version 3.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("conditionally-display-featured-image-on-singular-pages.php" instead of "conditional-featured-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected18,693 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JSON20018,262
PHP5109429344
JavaScript27087

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity18.67
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods412.50%
▷ Public methods2062.50%
▷ Protected methods00.00%
▷ Private methods1237.50%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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