68% gold-price

Code Review | Gold Price

WordPress plugin Gold Price scored 68% from 54 tests.

About plugin

  • Plugin page: gold-price
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.7.4
  • WordPress version: 6.3.1
  • First release: Nov 29, 2013
  • Latest release: Nov 29, 2016
  • Number of updates: 18
  • Update frequency: every 69.9 days
  • Top authors: EnigmaWeb (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

300+ active / 9,012 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.89MB] [CPU: ▼56.50ms] Passed 4 tests

An overview of server-side resources used by Gold Price
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.27 ▼35.76
Dashboard /wp-admin2.12 ▼1.186.45 ▼42.76
Posts /wp-admin/edit.php2.12 ▼1.246.30 ▼48.06
Add New Post /wp-admin/post-new.php2.12 ▼3.776.38 ▼99.42
Media Library /wp-admin/upload.php2.12 ▼1.115.80 ▼27.15
Settings /wp-admin/admin.php?page=gold_prices2.125.93

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Gold Price
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲10513.31 ▼1.075.60 ▲3.8938.42 ▼8.19
Dashboard /wp-admin2,235 ▲475.88 ▲1.01107.03 ▲6.7370.43 ▲27.16
Posts /wp-admin/edit.php2,121 ▲322.03 ▲0.0337.62 ▼2.4133.57 ▼1.89
Add New Post /wp-admin/post-new.php1,564 ▲2223.24 ▲4.99748.24 ▲131.8769.45 ▲15.36
Media Library /wp-admin/upload.php1,423 ▲354.15 ▼0.06113.41 ▲15.1945.21 ▲3.92
Settings /wp-admin/admin.php?page=gold_prices1,3171.8624.8432.31

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the gp-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=gold_prices
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the gp-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=gold_prices
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the gp-css1 handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=gold_prices
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'gold_prices' not found or invalid function name

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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/gold-price/settings.php:18

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: silver, gold price live, gold price, gold, gold widget...

gold-price/admin.php 85% from 13 tests

The main PHP file in "Gold Price" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 176 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gold-price.php" instead of "admin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected456 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22819318
CSS274138

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.51
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
gold-price.png3.22KB0.58KB▼ 81.94%