94% this-or-that

Code Review | This-or-That

WordPress plugin This-or-That scored 94% from 54 tests.

About plugin

  • Plugin page: this-or-that
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-4.1
  • WordPress version: 5.8.1
  • First release: Nov 2, 2013
  • Latest release: Jan 9, 2015
  • Number of updates: 13
  • Update frequency: every 33.5 days
  • Top authors: andrex84 (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

70+ active / 4,711 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by This-or-That
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0425.38 ▲1.39
Dashboard /wp-admin3.09 ▲0.0337.67 ▲1.34
Posts /wp-admin/edit.php3.15 ▲0.0431.76 ▼16.15
Add New Post /wp-admin/post-new.php5.46 ▲0.0268.68 ▼698.94
Media Library /wp-admin/upload.php3.04 ▲0.0322.39 ▲0.30
Categories /wp-admin/edit-tags.php?taxonomy=thisorthat_category&post_type=this-or-that3.0420.55
Add item /wp-admin/post-new.php?post_type=this-or-that3.1537.05
All items /wp-admin/edit.php?post_type=this-or-that3.0824.00

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This-or-That: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,848 ▲24616.50 ▲0.508.96 ▲4.2774.27 ▼6.35
Dashboard /wp-admin2,977 ▲786.15 ▼0.03115.72 ▼16.55164.77 ▼5.35
Posts /wp-admin/edit.php2,789 ▲463.25 ▲0.0164.91 ▲2.19135.65 ▼5.49
Add New Post /wp-admin/post-new.php3,839 ▲9620.37 ▲1.56408.57 ▼49.92153.16 ▼11.12
Media Library /wp-admin/upload.php1,800 ▲515.52 ▼0.03140.41 ▲2.83186.34 ▲1.42
Categories /wp-admin/edit-tags.php?taxonomy=thisorthat_category&post_type=this-or-that1,7742.7761.73130.53
Add item /wp-admin/post-new.php?post_type=this-or-that3,29410.08194.95230.65
All items /wp-admin/edit.php?post_type=this-or-that1,5512.9559.64112.15

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/this-or-that/this-or-that.php:36

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 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
Attributes that need to be fixed:
  • Tags: There are too many tags (16 tag instead of maximum 10)
The official readme.txt is a good inspiration

this-or-that/this-or-that.php 92% from 13 tests

The primary PHP file in "This-or-That" version 1.0.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 147 characters long)

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 plugin551 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP117241382
CSS12710130
JavaScript111639

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1266.67%
▷ Protected methods633.33%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon-adminpage32.png2.52KB1.51KB▼ 39.83%
img/seperat_or.png1.95KB0.58KB▼ 70.23%
img/icon-adminmenu16-sprite_2x.png4.25KB2.08KB▼ 50.99%
img/icon-adminpage32_2x.png7.82KB3.13KB▼ 60.02%
img/icon-adminmenu16-sprite.png2.25KB1.28KB▼ 43.22%