67% oxford-debate

Code Review | Oxford Debate

WordPress plugin Oxford Debate scored 67% from 54 tests.

About plugin

  • Plugin page: oxford-debate
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.1
  • WordPress version: 5.8.1
  • First release: Feb 18, 2015
  • Latest release: Jan 19, 2017
  • Number of updates: 36
  • Update frequency: every 19.5 days
  • Top authors: rafafc (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active / 2,811 total downloads

Benchmarks

Plugin footprint 65% 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.72MB] [CPU: ▼179.93ms] Passed 4 tests

An overview of server-side resources used by Oxford Debate
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2547.48 ▲25.62
Dashboard /wp-admin2.93 ▼0.1331.94 ▼11.93
Posts /wp-admin/edit.php2.93 ▼0.1829.25 ▼14.35
Add New Post /wp-admin/post-new.php2.93 ▼2.5030.82 ▼691.32
Media Library /wp-admin/upload.php2.93 ▼0.0836.37 ▼2.11
OxD Settings /wp-admin/options-general.php?page=oxd-admin-page2.9333.19
Proposal Categories /wp-admin/edit-tags.php?taxonomy=posture_category&post_type=posture2.9339.83
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=debate2.9333.25
Debate Categories /wp-admin/edit-tags.php?taxonomy=debate_category&post_type=debate2.9333.11
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=posture2.9332.76

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 64 new files
Database: no new tables, 1 new option
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

An overview of browser requirements for Oxford Debate
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,978 ▲38216.66 ▲1.1214.01 ▲5.9749.35 ▼0.30
Dashboard /wp-admin3,091 ▲1976.84 ▲1.01137.59 ▼24.35144.38 ▲35.87
Posts /wp-admin/edit.php2,883 ▲1443.03 ▲0.3369.56 ▲1.49110.38 ▲14.65
Add New Post /wp-admin/post-new.php45 ▼3,6850.90 ▼14.270.04 ▼413.2930.62 ▼77.70
Media Library /wp-admin/upload.php1,948 ▲1415.48 ▲0.49125.70 ▼21.97143.36 ▲26.09
OxD Settings /wp-admin/options-general.php?page=oxd-admin-page3,16611.22302.97147.84
Proposal Categories /wp-admin/edit-tags.php?taxonomy=posture_category&post_type=posture1,8932.8263.9498.35
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=debate1,9772.8160.5091.21
Debate Categories /wp-admin/edit-tags.php?taxonomy=debate_category&post_type=debate1,8902.8259.58106.04
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=posture1,9772.8258.93103.94

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=posture
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=oxd-admin-page
    • > Warning in wp-content/plugins/oxford-debate/oxd.php+524
    Use of undefined constant yes - assumed 'yes' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/oxford-debate/templates/comments-debate.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function home_url() in wp-content/plugins/oxford-debate/templates/single-debate.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Donate link: Invalid URI found ("")
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Screenshot #2 (Example of social media sharing feature.) image missing
The official readme.txt might help

oxford-debate/oxd.php 85% from 13 tests

Analyzing the main PHP file in "Oxford Debate" version 2.1.3
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("oxford-debate.php" instead of "oxd.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
Good job! No executable or dangerous file extensions detected10,744 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript85273184,843
CSS683382,986
PHP75261372,030
HTML3501402
PO File1128157301
JSON300147
Markdown122035

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity43.50
▷ Minimum class complexity42.00
▷ Maximum class complexity45.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
30 PNG files occupy 1.05MB with 0.57MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_in.png0.48KB0.23KB▼ 51.22%
assets/datetimepicker-master/screen/4.png12.29KB5.50KB▼ 55.26%
img/icon_email.png0.67KB0.30KB▼ 55.67%
img/icon_x.png0.52KB0.25KB▼ 51.98%
assets/screenshot-1.png935.67KB386.36KB▼ 58.71%