83% gold-price-based-on-weight

Code Review | Gold-Price

WordPress plugin Gold-Price scored83%from 54 tests.

About plugin

  • Plugin page: gold-price-based-...
  • Plugin version: 1.7
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.2
  • WordPress version: 6.3.1
  • First release: Aug 16, 2021
  • Latest release: Apr 10, 2023
  • Number of updates: 43
  • Update frequency: every 14.1 days
  • Top authors: vimakava (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

100+ active /2,829 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.47ms] 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 /3.49 ▲0.0337.66 ▼6.12
Dashboard /wp-admin3.34 ▼0.0146.82 ▼13.33
Posts /wp-admin/edit.php3.39 ▲0.0345.88 ▲3.21
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.39 ▼21.65
Media Library /wp-admin/upload.php3.26 ▲0.0336.00 ▲5.82

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments

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,816 ▲7013.35 ▼1.031.77 ▲0.0040.76 ▼1.70
Dashboard /wp-admin2,225 ▲404.88 ▼0.0196.60 ▼8.3639.41 ▲1.19
Posts /wp-admin/edit.php2,105 ▲132.03 ▼0.0040.95 ▲1.0337.64 ▼0.19
Add New Post /wp-admin/post-new.php1,551 ▲2018.87 ▲0.51600.59 ▲0.4953.17 ▲3.05
Media Library /wp-admin/upload.php1,404 ▲164.28 ▲0.1194.84 ▼5.4944.20 ▲0.13

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/gold-price-based-on-weight/gold-price.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gold-price-based-on-weight/includes/plugin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4 in gold-price-based-on-weight/assets to your readme.txt
The official readme.txt might help

gold-price-based-on-weight/gold-price.php 69% from 13 tests

The primary PHP file in "Gold-Price" version 1.7 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gold-price-based-on-weight.php" instead of "gold-price.php")
  • Domain Path: The domain path folder was not found ("/languages")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 156 characters long)

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 detected301 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24119253
CSS151248

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/uploads/check-mark.png2.53KB1.70KB▼ 32.52%
assets/uploads/logo-black-text.png47.92KB19.92KB▼ 58.44%