72% theatre

Code Review | Theater for WordPress

WordPress plugin Theater for WordPress scored72%from 54 tests.

About plugin

  • Plugin page: theatre
  • Plugin version: 0.18.3
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.6
  • WordPress version: 6.3.1
  • First release: Dec 22, 2013
  • Latest release: Jan 25, 2021
  • Number of updates: 265
  • Update frequency: every 9.8 days
  • Top authors: slimndap (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

700+ active /34,045 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.78MB] [CPU: ▲4.77ms] 75% from 4 tests

This is a short check of server-side resources used by Theater for WordPress
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 610.60ms on /wp-admin/admin.php?page=wpt_extensions)
PageMemory (MB)CPU Time (ms)
Home /5.29 ▲1.8251.32 ▲8.27
Dashboard /wp-admin5.05 ▲1.7461.24 ▲8.22
Posts /wp-admin/edit.php5.19 ▲1.8363.94 ▲13.03
Add New Post /wp-admin/post-new.php7.73 ▲1.83101.23 ▼10.45
Media Library /wp-admin/upload.php4.98 ▲1.7456.66 ▲17.17
Events /wp-admin/admin.php?page=theater-events4.9848.62
Import events /wp-admin/admin.php?page=wpt_jeero5.37841.17
Settings /wp-admin/admin.php?page=wpt_admin4.9444.71
Extensions /wp-admin/admin.php?page=wpt_extensions4.95610.60
Seasons /wp-admin/edit.php?post_type=wp_theatre_season5.0457.93

Server storage [IO: ▲0.54MB] [DB: ▲0.08MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 64 new files
Database: no new tables, 12 new options
New WordPress options
widget_wpt_events_widget
db_upgraded
widget_wpt_productions_widget
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theater_last_succesful_update_order_indexes_timestamp
widget_recent-comments
widget_wpt_production_widget
wpt_version
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Theater for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲18113.52 ▼0.778.24 ▲6.2740.45 ▼4.18
Dashboard /wp-admin2,251 ▲745.79 ▲0.1992.26 ▼4.4541.13 ▼2.00
Posts /wp-admin/edit.php2,156 ▲562.25 ▲0.2736.92 ▼2.0738.74 ▲4.36
Add New Post /wp-admin/post-new.php1,575 ▲4923.39 ▲0.47627.96 ▼64.9137.08 ▼19.23
Media Library /wp-admin/upload.php1,456 ▲594.31 ▲0.11106.31 ▼7.7648.88 ▲3.90
Events /wp-admin/admin.php?page=theater-events1,0231.7427.7228.79
Import events /wp-admin/admin.php?page=wpt_jeero2,2471.7726.9342.10
Settings /wp-admin/admin.php?page=wpt_admin1,0251.7827.5131.19
Extensions /wp-admin/admin.php?page=wpt_extensions8341.7828.2143.18
Seasons /wp-admin/edit.php?post_type=wp_theatre_season1,1292.2132.6629.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_wpt_productions_widget
    • db_upgraded
    • can_compress_scripts
    • widget_wpt_events_widget
    • theysaidso_admin_options
    • wpt_version
    • widget_wpt_production_widget
    • widget_recent-comments
    • widget_wpt_production_events_widget
    • theater_last_succesful_update_order_indexes_timestamp
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=wpt_admin
    • > Notice in wp-content/plugins/theatre/functions/wpt_listing_page.php+375
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/theatre/functions/wpt_calendar.php:405
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/theatre/functions/wpt_widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theatre/integrations/wordpress-seo.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/theatre/functions/wpt_listing_page.php:907
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/theatre/integrations/jetpack-featured-content.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/theatre/functions/wpt_production_widget.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPT_Listing' not found in wp-content/plugins/theatre/functions/wpt_productions.php:11
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/theatre/functions/wpt_productions_list_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/theatre/functions/wpt_events_widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/theatre/functions/event/class-theater-event-embed.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wp_theatre_season
    • > Network (severe)
    https://npmcdn.com/flatpickr@4.6.13/dist/l10n/en.js - Failed to load resource: the server responded with a status of 404 ()
    • > GET request to /wp-admin/admin.php?page=wpt_jeero
    • > Network (severe)
    https://d25hbnzl4ir3oh.cloudfront.net/calendars/thumb/Eventive.png - Failed to load resource: the server responded with a status of 403 ()

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 reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

theatre/theater.php 92% from 13 tests

Analyzing the main PHP file in "Theater for WordPress" version 0.18.3
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 ("theatre.php" instead of "theater.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
There were no executable files found in this plugin9,541 lines of code in 56 files:
LanguageFilesBlank linesComment linesLines of code
PHP492,5546,1458,195
CSS20221,000
PO File2145362332
SVG10012
JavaScript2002

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity21.94
▷ Minimum class complexity1.00
▷ Maximum class complexity111.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes51
▷ Abstract classes00.00%
▷ Concrete classes51100.00%
▷ Final classes00.00%
Methods521
▷ Static methods305.76%
▷ Public methods43683.69%
▷ Protected methods509.60%
▷ Private methods356.72%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants220.00%
▷ Class constants880.00%
▷ Public constants8100.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
There were not PNG files found in your plugin