84% wonderplugin-conditional-display

Code Review | Conditional Display for Mobile - Mobile Detect Plugin

WordPress plugin Conditional Display for Mobile - Mobile Detect Plugin scored84%from 54 tests.

About plugin

  • Plugin page: wonderplugin-cond...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-5.9.3
  • WordPress version: 6.3.1
  • First release: Jun 15, 2016
  • Latest release: May 14, 2022
  • Number of updates: 21
  • Update frequency: every 102.8 days
  • Top authors: wonderplugin (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

3,000+ active /31,108 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.19ms] Passed 4 tests

A check of server-side resources used by Conditional Display for Mobile - Mobile Detect Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.83 ▼1.01
Dashboard /wp-admin3.31 ▼0.0448.82 ▼15.92
Posts /wp-admin/edit.php3.36 ▲0.0047.30 ▼4.31
Add New Post /wp-admin/post-new.php5.89 ▲0.0095.47 ▼13.38
Media Library /wp-admin/upload.php3.23 ▲0.0035.93 ▼3.13

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Conditional Display for Mobile - Mobile Detect Plugin: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.37 ▲0.202.10 ▲0.4445.01 ▲4.70
Dashboard /wp-admin2,195 ▲145.67 ▼0.0694.58 ▼15.8741.46 ▼0.94
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0234.19 ▼6.6736.41 ▼0.69
Add New Post /wp-admin/post-new.php1,547 ▲2123.27 ▲5.61676.50 ▲3.2553.46 ▼10.49
Media Library /wp-admin/upload.php1,400 ▼04.22 ▼0.04104.15 ▼10.6748.70 ▼0.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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 trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wonderplugin-conditional-display/wonderplugin-cond.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt might help

wonderplugin-conditional-display/wonderplugin-cond.php 92% from 13 tests

The main file in "Conditional Display for Mobile - Mobile Detect Plugin" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wonderplugin-conditional-display.php" instead of "wonderplugin-cond.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected238 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14513238

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.90
Average class complexity79.00
▷ Minimum class complexity79.00
▷ Maximum class complexity79.00
Average method complexity14.00
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
PNG images were not found in this plugin