78% precious-metals-chart-and-widgets

Code Review | Precious Metals Charts and Widgets for WordPress

WordPress plugin Precious Metals Charts and Widgets for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: precious-metals-c...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 16, 2016
  • Latest release: Jul 3, 2023
  • Number of updates: 22
  • Update frequency: every 112.8 days
  • Top authors: nfusionsolutions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /4,817 total downloads

Benchmarks

Plugin footprint 83% 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: ▼0.66MB] [CPU: ▼14.48ms] Passed 4 tests

Server-side resources used by Precious Metals Charts and Widgets for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.27 ▼2.91
Dashboard /wp-admin3.34 ▲0.0444.82 ▼4.78
Posts /wp-admin/edit.php3.39 ▲0.0348.03 ▲2.89
Add New Post /wp-admin/post-new.php3.12 ▼2.7633.35 ▼50.08
Media Library /wp-admin/upload.php3.26 ▲0.0332.01 ▼0.14
All nFusion Widgets /wp-admin/edit.php?post_type=nfusion-widgets3.3037.15
Add New /wp-admin/post-new.php?post_type=nfusion-widgets3.1232.69

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_netgo_nfusion
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Precious Metals Charts and Widgets for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲20413.90 ▼0.528.17 ▲6.3839.11 ▼9.48
Dashboard /wp-admin2,238 ▲504.86 ▼0.2199.28 ▼5.0541.09 ▲0.61
Posts /wp-admin/edit.php2,118 ▲292.00 ▼0.0137.70 ▲4.2029.81 ▼9.53
Add New Post /wp-admin/post-new.php1,556 ▲4223.30 ▲5.56633.53 ▲26.2551.47 ▲1.11
Media Library /wp-admin/upload.php1,411 ▲264.28 ▲0.09100.72 ▲0.0339.89 ▼4.13
All nFusion Widgets /wp-admin/edit.php?post_type=nfusion-widgets1,0791.9332.4028.18
Add New /wp-admin/post-new.php?post_type=nfusion-widgets1,5482.6248.7547.28

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_netgo_nfusion
    • db_upgraded
    • widget_theysaidso_widget

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+149
    Undefined index: post_type
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+158
    Undefined index: nfusion_chart_code
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+161
    Undefined index: nfusion_parameters
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+164
    Undefined index: nfusion_full_fidth
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+167
    Undefined index: nfusion_fixed_width
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+123
    Undefined variable: selected1
    • > GET request to /wp-admin/post-new.php?post_type=nfusion-widgets
    • > Notice in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php+124
    Undefined variable: selected2

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/precious-metals-chart-and-widgets/wp-nFusion-Widgets.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

precious-metals-chart-and-widgets/wp-nFusion-Widgets.php 92% from 13 tests

"Precious Metals Charts and Widgets for WordPress" version 1.2.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("precious-metals-chart-and-widgets.php" instead of "wp-nFusion-Widgets.php")

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
No dangerous file extensions were detected382 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP17621360
JavaScript12017
CSS1005

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions1694.12%
▷ Anonymous functions15.88%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin