84% golden-ticket

Code Review | Golden Ticket

WordPress plugin Golden Ticket scored84%from 54 tests.

About plugin

  • Plugin page: golden-ticket
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.6.1
  • WordPress version: 6.3.1
  • First release: Nov 5, 2013
  • Latest release: Jun 5, 2015
  • Number of updates: 14
  • Update frequency: every 41.2 days
  • Top authors: The Plugin Factory (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,541 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.17ms] Passed 4 tests

This is a short check of server-side resources used by Golden Ticket
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0343.54 ▲4.06
Dashboard /wp-admin3.32 ▲0.0143.89 ▼3.40
Posts /wp-admin/edit.php3.37 ▲0.0145.37 ▼4.01
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.63 ▼12.64
Media Library /wp-admin/upload.php3.24 ▲0.0135.59 ▼0.62

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Golden Ticket
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,894 ▲15914.00 ▼0.285.32 ▲3.2142.63 ▼10.14
Dashboard /wp-admin2,224 ▲364.93 ▲0.04102.95 ▼12.1783.34 ▲36.82
Posts /wp-admin/edit.php2,121 ▲322.25 ▲0.2541.23 ▲5.0236.25 ▲0.19
Add New Post /wp-admin/post-new.php1,544 ▲1518.41 ▼4.69631.45 ▼48.9665.02 ▲13.91
Media Library /wp-admin/upload.php1,413 ▲254.24 ▲0.0496.84 ▲1.0671.19 ▲29.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/golden-ticket/admin_functions.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/golden-ticket/admin_functions.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/golden-ticket/admin_functions.php:10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/golden-ticket/admin_functions.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/golden-ticket/index.php:284

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: promotion, seo, giveaways, coupon, rewards

golden-ticket/index.php 92% from 13 tests

"Golden Ticket" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("golden-ticket.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin647 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP315445610
JavaScript27337

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.64
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ticket-icon-16.png3.47KB0.79KB▼ 77.30%
images/ThePluginFactoryLogo.png9.95KB4.77KB▼ 51.99%
images/ticket-icon.png3.91KB2.38KB▼ 39.27%
images/ticket-add-on-icon-16.png0.77KB0.86KB0.00%