10% showdown

Code Review | Showdown

WordPress plugin Showdown scored 10% from 54 tests.

About plugin

  • Plugin page: showdown
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 5.8.1
  • First release: Jun 4, 2014
  • Latest release: May 22, 2016
  • Number of updates: 5
  • Update frequency: every 143.6 days
  • Top authors: owencutajar (60%)Weborithm (60%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,037 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/showdown/php/competitor_class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; TypeCompetitors has a deprecated constructor

Server metrics [RAM: ▼1.67MB] [CPU: ▼189.13ms] Passed 4 tests

This is a short check of server-side resources used by Showdown
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.97 ▼0.875.87 ▼29.67
Dashboard /wp-admin1.99 ▼1.076.09 ▼39.37
Posts /wp-admin/edit.php1.99 ▼1.126.40 ▼38.40
Add New Post /wp-admin/post-new.php1.99 ▼3.455.39 ▼646.16
Media Library /wp-admin/upload.php1.99 ▼1.025.65 ▼32.59
Add New /wp-admin/post-new.php?post_type=competitor1.996.01
Groups /wp-admin/edit-tags.php?taxonomy=groups&post_type=competitor1.995.86
Competitors /wp-admin/edit.php?post_type=competitor1.9910.53

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 2 new options
New WordPress options
WPShowdownOptions
widget_top10widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Showdown
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,914 ▲31816.30 ▲0.6213.44 ▲0.6546.35 ▼0.56
Dashboard /wp-admin3,057 ▲1235.98 ▼0.08138.75 ▼3.47106.81 ▼6.36
Posts /wp-admin/edit.php2,832 ▲932.73 ▲0.0160.78 ▼5.5788.44 ▲1.66
Add New Post /wp-admin/post-new.php2,164 ▲10718.97 ▼0.40365.55 ▲0.32113.93 ▲6.24
Media Library /wp-admin/upload.php1,900 ▲935.07 ▲0.04151.75 ▼18.90118.19 ▼6.91
Customise /wp-admin/showdown.php?page=customise260.900.1211.22
Styling /wp-admin/showdown.php?page=styling260.900.068.99
Settings /wp-admin/showdown.php?page=settings260.900.409.04
ShowDown /wp-admin/showdown.php260.900.069.36
Add New /wp-admin/post-new.php?post_type=competitor3,6119.06216.54150.05
Groups /wp-admin/edit-tags.php?taxonomy=groups&post_type=competitor1,8292.4161.8182.09
Competitors /wp-admin/edit.php?post_type=competitor1,5272.6660.0369.83

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/showdown/php/competitor_class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; TypeCompetitors has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_top10widget
    • WPShowdownOptions

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=competitor
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/showdown/php/competitor_class.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; TypeCompetitors has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=competitor
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/showdown/php/showdown_engine.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; ArenaEngine has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=competitor
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/showdown/php/showdown_widgets.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; Top10Widget has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=competitor
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/showdown/php/showdown_widgets.php+120
    Function create_function() is deprecated
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=competitor
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in Top10Widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+187
    Undefined index: title
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+187
    Undefined index: description
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+187
    Undefined index: groups
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+187
    Undefined index: image
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+215
    Undefined index: link
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+228
    Undefined index: mode
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+238
    Undefined index: points
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+215
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+239
    Undefined index: shown
    • > GET request to /wp-admin/post-new.php?post_type=competitor
    • > Notice in wp-content/plugins/showdown/php/competitor_class.php+254
    Undefined index: lastIP

SRP 0% 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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/showdown/php/showdown_widgets.php
    • > /wp-content/plugins/showdown/php/post_enhancer.php
    • > /wp-content/plugins/showdown/css/wp-showdown.css.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/showdown/php/showdown_engine.php:295
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/showdown/php/competitor_class.php:341
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/showdown/showdown.php:23

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/showdown.php?page=customise
    • > Network (severe)
    wp-admin/showdown.php?page=customise - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/showdown.php?page=styling
    • > Network (severe)
    wp-admin/showdown.php?page=styling - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/showdown.php?page=settings
    • > Network (severe)
    wp-admin/showdown.php?page=settings - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/showdown.php
    • > Network (severe)
    wp-admin/showdown.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: photo rating, polls, hot or not, contests, popularity...

showdown/showdown.php 92% from 13 tests

This is the main PHP file of "Showdown" version 1.2.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,775 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP63131031,116
JavaScript2110114565
CSS1141094

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity18.20
▷ Minimum class complexity10.00
▷ Maximum class complexity25.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
12 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/icon.png1.69KB0.80KB▼ 52.60%
css/draw.png1.81KB0.96KB▼ 46.92%
images/reddude.png9.35KB3.48KB▼ 62.78%
css/announcement.png1.34KB0.64KB▼ 52.07%
css/loser.png1.90KB1.06KB▼ 44.41%