79% theatre-wp

Code Review | Theatre WP

WordPress plugin Theatre WP scored79%from 54 tests.

About plugin

  • Plugin page: theatre-wp
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9
  • WordPress version: 6.3.1
  • First release: Dec 12, 2013
  • Latest release: Mar 7, 2022
  • Number of updates: 114
  • Update frequency: every 26.4 days
  • Top authors: bollofino (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /8,967 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▼0.84ms] Passed 4 tests

An overview of server-side resources used by Theatre WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6140.72 ▼4.23
Dashboard /wp-admin4.01 ▲0.7155.75 ▲6.78
Posts /wp-admin/edit.php4.06 ▲0.7057.45 ▲7.47
Add New Post /wp-admin/post-new.php6.55 ▲0.6691.11 ▼13.38
Media Library /wp-admin/upload.php3.93 ▲0.7045.56 ▲10.24
Add new /wp-admin/post-new.php?post_type=spectacle4.0759.42
Spectacles /wp-admin/edit.php?post_type=spectacle3.9750.03
Add new /wp-admin/post-new.php?post_type=performance4.0155.49
Performances /wp-admin/edit.php?post_type=performance3.9744.78
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=spectacle3.9340.64
Theatre WP /wp-admin/options-general.php?page=theatre-wp3.8440.77
Add new /wp-admin/post-new.php?post_type=sponsor4.0555.12
Sponsors /wp-admin/edit.php?post_type=sponsor3.9746.09
Format /wp-admin/edit-tags.php?taxonomy=format&post_type=spectacle3.9239.69

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 59 new files
Database: no new tables, 25 new options
New WordPress options
twp_google_maps_api
twp_spectacles_number
widget_twp-next-performances
can_compress_scripts
theysaidso_admin_options
db_upgraded
twp_performances_name
widget_recent-comments
twp_performances_slug
twp_performance_slug
...

Browser metrics Passed 4 tests

A check of browser resources used by Theatre WP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲15813.23 ▼1.171.82 ▼0.2441.36 ▲1.53
Dashboard /wp-admin2,326 ▲1355.04 ▲0.16102.86 ▼4.4941.26 ▲0.62
Posts /wp-admin/edit.php2,184 ▲952.04 ▲0.0341.19 ▼1.9336.89 ▼7.34
Add New Post /wp-admin/post-new.php1,626 ▲9818.51 ▲0.32646.57 ▲14.0753.25 ▼3.40
Media Library /wp-admin/upload.php1,483 ▲954.23 ▲0.0595.00 ▼10.6741.84 ▼0.68
Add new /wp-admin/post-new.php?post_type=spectacle2,9339.30248.1589.00
Spectacles /wp-admin/edit.php?post_type=spectacle1,1731.9631.3140.02
Add new /wp-admin/post-new.php?post_type=performance1,9104.0184.4234.11
Performances /wp-admin/edit.php?post_type=performance1,1721.9532.9531.46
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=spectacle1,3992.2730.6731.54
Theatre WP /wp-admin/options-general.php?page=theatre-wp1,0252.1823.5728.29
Add new /wp-admin/post-new.php?post_type=sponsor2,3187.75160.8457.82
Sponsors /wp-admin/edit.php?post_type=sponsor1,1452.0130.3530.94
Format /wp-admin/edit-tags.php?taxonomy=format&post_type=spectacle1,3602.1426.8828.72

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 25 options
    • twp_performance_name
    • widget_theysaidso_widget
    • twp_performances_number
    • twp_spectacles_slug
    • twp_clean_on_uninstall
    • twp_performance_slug
    • twp_performances_name
    • twp_spectacle_slug
    • widget_recent-posts
    • widget_twp-next-performances
    • ...

Smoke tests 50% 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 0% 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
  • 12× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-sponsor.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/widgets/class-spectacleswidget.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-setup.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/widgets/class-productionsponsorswidget.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-performance.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/widgets/class-upcomingperformanceswidget.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/widgets/class-showupcomingperformanceswidget.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-metabox.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-spectacle.php
    • > /wp-content/plugins/theatre-wp/classes/theatrewp/class-theatrewp.php
  • 4095× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 10
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11
    • > PHP Notice
      Undefined variable: calendar_data in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 10
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 10
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11
    • > PHP Notice
      Undefined variable: selected_year in wp-content/plugins/theatre-wp/includes/templates/check-dates-form.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: dance, troupe, performing arts, theatre

theatre-wp/theatre-wp.php Passed 13 tests

The principal PHP file in "Theatre WP" v. 1.0 is loaded by WordPress automatically on each request
89 characters long description:
CMS for Theatre and Performing Arts Companies. Managing Shows and Performances made easy.

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
Good job! No executable or dangerous file extensions detected4,203 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP217748542,649
PO File44937451,122
CSS32015387
JavaScript272631
SVG10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity29.80
▷ Minimum class complexity4.00
▷ Maximum class complexity75.00
Average method complexity3.53
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods114
▷ Static methods1815.79%
▷ Public methods10390.35%
▷ Protected methods00.00%
▷ Private methods119.65%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
15 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%