10% its-jewellery-price

Code Review | ITS Jewellery Price Plugin

WordPress plugin ITS Jewellery Price Plugin scored10%from 54 tests.

About plugin

  • Plugin page: its-jewellery-price
  • Plugin version: 23.07.20
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.2-6.2.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2022
  • Latest release: Jul 20, 2023
  • Number of updates: 72
  • Update frequency: every 5.9 days
  • Top authors: ifelsetech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /3,355 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Error in wp-content/plugins/its-jewellery-price/includes/class-jewellery-price-activator.php+236
    Uncaught Error: Class 'WC_Cache_Helper' not found in wp-content/plugins/its-jewellery-price/includes/class-jewellery-price-activator.php:236
    Stack trace:
    #0 wp-content/plugins/its-jewellery-price/includes/class-jewellery-price-activator.php(137): Jewellery_Price_Activator::createAttribute()
    #1 wp-content/plugins/its-jewellery-price/its-jewellery-price.php(77): Jewellery_Price_Activator::activate()
    #2 wp-includes/class-wp-hook.php(310): activate_jewellery_price()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.44ms] Passed 4 tests

An overview of server-side resources used by ITS Jewellery Price Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.45 ▼3.31
Dashboard /wp-admin3.31 ▲0.0050.24 ▼2.18
Posts /wp-admin/edit.php3.36 ▲0.0049.97 ▲0.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.77 ▼4.49
Media Library /wp-admin/upload.php3.23 ▲0.0038.35 ▲4.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 60 new files
Database: 4 new tables, 6 new options
New tables
wp_its_jp_metal_price_logs
wp_its_jp_price_metal_groups
wp_its_jp_price_settings
wp_its_jp_product_price_logs
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

ITS Jewellery Price Plugin: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▼0.011.91 ▼0.0641.43 ▲0.23
Dashboard /wp-admin2,198 ▲215.59 ▼0.0783.34 ▼9.5243.25 ▼4.63
Posts /wp-admin/edit.php2,097 ▼32.01 ▲0.0137.51 ▲0.6633.66 ▼12.24
Add New Post /wp-admin/post-new.php1,531 ▲523.18 ▲0.05695.24 ▲51.7553.35 ▼6.50
Media Library /wp-admin/upload.php1,397 ▼34.28 ▲0.09114.15 ▲11.6046.91 ▼1.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_its_jp_price_metal_groups
    • wp_its_jp_product_price_logs
    • wp_its_jp_price_settings
    • wp_its_jp_metal_price_logs
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 10× PHP files output text when accessed directly:
    • > /wp-content/plugins/its-jewellery-price/admin/partials/settings/add-metal-group.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/plugin-activation/user-details-form.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-footer.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/settings/shortcodes.php
    • > /wp-content/plugins/its-jewellery-price/public/partials/its-price-breakup-public-display.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/settings/general.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-addons.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/settings/add-metal.php
    • > /wp-content/plugins/its-jewellery-price/admin/partials/settings/discount.php
    • > /wp-content/plugins/its-jewellery-price/public/partials/jewellery-price-public-display.php
  • 37× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      include_once(JEWELLERY_PRICE_PLUGIN_PATHadmin/partials/jewellery-price-admin-header.php): failed to open stream: No such file or directory in wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-display.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/its-jewellery-price/includes/class-itsjp-activate.php:4
    • > PHP Warning
      include_once(): Failed opening 'JEWELLERY_PRICE_PLUGIN_PATHadmin/partials/jewellery-price-admin-header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-settings.php on line 16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-product-price-log.php:26
    • > PHP Warning
      Use of undefined constant JEWELLERY_PRICE_PLUGIN_URL - assumed 'JEWELLERY_PRICE_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/its-jewellery-price/admin/partials/settings/add-metal-group.php on line 3
    • > PHP Warning
      Use of undefined constant JEWELLERY_PRICE_PLUGIN_URL - assumed 'JEWELLERY_PRICE_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/its-jewellery-price/admin/partials/settings/discount.php on line 3
    • > PHP Warning
      Use of undefined constant JEWELLERY_PRICE_PLUGIN_PATH - assumed 'JEWELLERY_PRICE_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-addons.php on line 14
    • > PHP Warning
      include_once(): Failed opening 'JEWELLERY_PRICE_PLUGIN_PATHadmin/partials/jewellery-price-admin-header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/its-jewellery-price/admin/partials/its-price-breakup-admin-display.php on line 15
    • > PHP Warning
      Use of undefined constant JEWELLERY_PRICE_PLUGIN_PATH - assumed 'JEWELLERY_PRICE_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/its-jewellery-price/admin/partials/jewellery-price-admin-settings.php on line 16
    • > PHP Warning
      include_once(JEWELLERY_PRICE_PLUGIN_PATHadmin/partials/jewellery-price-admin-header.php): failed to open stream: No such file or directory in wp-content/plugins/its-jewellery-price/admin/partials/its-price-breakup-admin-display.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: dynamic price-update, jewellery, gold price, diamond price, precious metals...

its-jewellery-price/its-jewellery-price.php 85% from 13 tests

The entry point to "ITS Jewellery Price Plugin" version 23.07.20 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 444 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
There were no executable files found in this plugin3,384 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP325529392,714
JavaScript69266404
CSS61458266

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity23.50
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity40.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods69
▷ Static methods57.25%
▷ Public methods6086.96%
▷ Protected methods00.00%
▷ Private methods913.04%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
6 PNG files occupy 0.30MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/general-tab-pro.png131.37KB36.43KB▼ 72.27%
admin/images/whatsapp-button.png2.00KB1.07KB▼ 46.61%
admin/images/metal-group-pro.png42.75KB15.62KB▼ 63.46%
admin/images/its-icon-logo.png31.79KB12.45KB▼ 60.83%
admin/images/discount-tab-pro.png49.58KB15.61KB▼ 68.52%