72% goldstar

Code Review | Goldstar

WordPress plugin Goldstar scored 72% from 54 tests.

About plugin

  • Plugin page: goldstar
  • Plugin version: 2.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.3
  • WordPress version: 5.8.1
  • First release: Feb 10, 2014
  • Latest release: Nov 28, 2019
  • Number of updates: 65
  • Update frequency: every 32.6 days
  • Top authors: jjtrabucco (89.23%)dsutoyo (12.31%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,565 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼135.82ms] Passed 4 tests

This is a short check of server-side resources used by Goldstar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.3140.68 ▲12.72
Dashboard /wp-admin3.36 ▲0.3056.26 ▲9.63
Posts /wp-admin/edit.php3.41 ▲0.2956.06 ▲8.83
Add New Post /wp-admin/post-new.php5.66 ▲0.2297.81 ▼555.27
Media Library /wp-admin/upload.php3.24 ▲0.2235.90 ▼6.46
Goldstar /wp-admin/options-general.php?page=admin-goldstar3.2934.42
Feature Events /wp-admin/admin.php?page=goldstar-featured-events3.2434.02
Configuration /wp-admin/admin.php?page=admin-goldstar3.2933.01

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 125 new files
Database: no new tables, 4 new options
New WordPress options
widget_goldstar_event_widget
goldstar_options
widget_goldstar_category_widget
widget_goldstar_teaser_widget

Browser metrics Passed 4 tests

Checking browser requirements for Goldstar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,753 ▲15716.45 ▲0.4610.32 ▼0.0148.37 ▲3.46
Dashboard /wp-admin3,014 ▲806.54 ▲0.61157.08 ▲8.55118.33 ▼5.29
Posts /wp-admin/edit.php2,778 ▲422.74 ▲0.0482.63 ▲8.87110.90 ▲15.79
Add New Post /wp-admin/post-new.php1,711 ▲9618.90 ▼2.57401.60 ▲112.37110.39 ▼10.03
Media Library /wp-admin/upload.php1,783 ▼245.20 ▲0.19140.65 ▼31.92123.50 ▼2.82
Goldstar /wp-admin/options-general.php?page=admin-goldstar1,9702.5871.5398.45
Feature Events /wp-admin/admin.php?page=goldstar-featured-events8761.8535.6046.38
Configuration /wp-admin/admin.php?page=admin-goldstar1,9702.5768.74102.06

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 does not fully uninstall, leaving 3 options in the database
    • widget_goldstar_category_widget
    • widget_goldstar_event_widget
    • widget_goldstar_teaser_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/goldstar/admin/_popup_territory.php
    • > /wp-content/plugins/goldstar/admin/_admin_menu.php
  • 30× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: arr_data in wp-content/plugins/goldstar/admin/_popup_territory.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/goldstar/frontend-template.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/goldstar/frontend.php:40
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/goldstar/widgets/category/frontend.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/goldstar/admin/admin.php:90
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/goldstar/widgets/category/category.php:3
    • > PHP Notice
      Undefined index: page in wp-content/plugins/goldstar/admin/_admin_menu.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/goldstar/list-event-template.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/goldstar/widgets/teaser/teaser.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/goldstar/goldstar.php:46

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-goldstar
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.1 1:31592 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/goldstar/js/goldstar_admin.js?ver=1.0:135:35)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.1:2:30340)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=admin-goldstar
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.8.1 1:31702 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Goldstar Plugin display example Desktop), #2 (Goldstar Plugin display example Mobile), #3 (Goldstar Single Event card embed), #4 (Admin affiliate ID and API key settings), #5 (Admin plugin Column and Event Card design), #6 (Admin plugin display settings), #7 (Featured Offer Widget example), #8 (Single Event Widget example), #9 (Event Category Widget example), #10 (Admin featured offer widget configuration settings), #11 (Admin featured offer widget Featured Events list), #12 (Admin featured offer widget display settings)
The official readme.txt might help

goldstar/goldstar.php Passed 13 tests

This is the main PHP file of "Goldstar" version 2.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
75 characters long description:
This plugin will provide a list of discount ticket offers from goldstar.com

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin44,524 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
SVG130832,813
JavaScript41,4045,9175,647
CSS82971252,700
PHP226232502,632
Sass71260732

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity17.57
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity4.52
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods2060.61%
▷ Public methods3296.97%
▷ Protected methods00.00%
▷ Private methods13.03%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants26
▷ Global constants00.00%
▷ Class constants26100.00%
▷ Public constants26100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
45 PNG files occupy 4.59MB with 1.77MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery-ui/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
img/jquery_data_table/back_disabled.png1.33KB0.60KB▼ 55.11%
screenshot-10.png10.42KB6.15KB▼ 40.97%
img/date-button.png0.54KB0.32KB▼ 41.11%
css/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%