78% metalpriceapi

Code Review | MetalpriceAPI

WordPress plugin MetalpriceAPI scored78%from 54 tests.

About plugin

  • Plugin page: metalpriceapi
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2.0
  • WordPress version: 6.3.1
  • First release: Jan 5, 2022
  • Latest release: Aug 7, 2023
  • Number of updates: 17
  • Update frequency: every 34.1 days
  • Top authors: metalpriceapi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /8,610 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼10.22ms] Passed 4 tests

An overview of server-side resources used by MetalpriceAPI
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.72 ▼8.02
Dashboard /wp-admin3.35 ▲0.0545.64 ▼4.56
Posts /wp-admin/edit.php3.40 ▲0.0446.75 ▼6.33
Add New Post /wp-admin/post-new.php5.93 ▲0.0484.29 ▼19.54
Media Library /wp-admin/upload.php3.28 ▲0.0435.39 ▼6.99
Instructions /wp-admin/admin.php?page=info3.2531.51
Settings /wp-admin/admin.php?page=settings3.3239.29

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by MetalpriceAPI
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10614.79 ▲0.131.78 ▼0.0337.33 ▲1.05
Dashboard /wp-admin2,233 ▲424.84 ▼1.0597.10 ▼7.4840.04 ▼1.13
Posts /wp-admin/edit.php2,116 ▲272.01 ▲0.0134.44 ▼5.5330.03 ▼7.27
Add New Post /wp-admin/post-new.php1,569 ▲5618.18 ▲0.51600.44 ▼93.1450.46 ▲6.10
Media Library /wp-admin/upload.php1,418 ▲364.17 ▼0.0593.72 ▼2.9041.44 ▼2.26
Instructions /wp-admin/admin.php?page=info1,0782.1821.4830.31
Settings /wp-admin/admin.php?page=settings2,54810.59229.5976.29

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/metalpriceapi/module/info.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/metalpriceapi/index.php:22
    • > PHP Notice
      Undefined variable: is_saved in wp-content/plugins/metalpriceapi/module/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/metalpriceapi/module/settings.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: metals rates, gold rates, silver rates, metal price api, metals api...

metalpriceapi/index.php 92% from 13 tests

The principal PHP file in "MetalpriceAPI" v. 1.0.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("metalpriceapi.php" instead of "index.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
Success! There were no dangerous files found in this plugin604 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP46210604

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity37.00
▷ Minimum class complexity37.00
▷ Maximum class complexity37.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin