84% wp-conditional-themes

Code Review | Conditional Themes

WordPress plugin Conditional Themes scored84%from 54 tests.

About plugin

  • Plugin page: wp-conditional-th...
  • Plugin version: 0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-5.2.2
  • WordPress version: 6.3.1
  • First release: Oct 19, 2013
  • Latest release: Jul 19, 2019
  • Number of updates: 13
  • Update frequency: every 161.5 days
  • Top authors: alex-ye (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /3,627 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.16ms] Passed 4 tests

This is a short check of server-side resources used by Conditional Themes
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0341.16 ▼0.44
Dashboard /wp-admin3.34 ▲0.0448.44 ▼4.98
Posts /wp-admin/edit.php3.45 ▲0.1050.45 ▲3.47
Add New Post /wp-admin/post-new.php5.92 ▲0.0387.52 ▼10.67
Media Library /wp-admin/upload.php3.26 ▲0.0337.69 ▲3.65

Server storage [IO: ▲0.03MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
It is recommended to fix the following issues
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/wp-conditional-themes/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Conditional Themes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.51 ▼1.082.49 ▲0.7545.07 ▲1.12
Dashboard /wp-admin2,218 ▲185.80 ▼0.0594.43 ▼15.5739.54 ▼2.46
Posts /wp-admin/edit.php2,100 ▲32.02 ▼0.0235.93 ▼4.2336.25 ▼0.50
Add New Post /wp-admin/post-new.php1,545 ▼1023.27 ▲4.92657.91 ▲15.7952.97 ▼1.30
Media Library /wp-admin/upload.php1,400 ▲34.25 ▼0.1295.61 ▼10.1942.78 ▼1.16

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-conditional-themes/main.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: switch, api, theme-switcher, themes, theme

wp-conditional-themes/main.php 92% from 13 tests

"Conditional Themes" version 0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-conditional-themes.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected229 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP485212229

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.41
Average class complexity19.00
▷ Minimum class complexity10.00
▷ Maximum class complexity28.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods23
▷ Static methods939.13%
▷ Public methods2086.96%
▷ Protected methods14.35%
▷ Private methods28.70%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin