83% zpt-metals

Code Review | ZPT Metals

WordPress plugin ZPT Metals scored83%from 54 tests.

About plugin

  • Plugin page: zpt-metals
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2020
  • Latest release: Jan 9, 2023
  • Number of updates: 37
  • Update frequency: every 22.1 days
  • Top authors: zactonz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,087 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼1.52ms] Passed 4 tests

Analyzing server-side resources used by ZPT Metals
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1337.18 ▼1.62
Dashboard /wp-admin3.44 ▲0.1348.49 ▼3.12
Posts /wp-admin/edit.php3.49 ▲0.1347.90 ▼1.48
Add New Post /wp-admin/post-new.php6.02 ▲0.1393.21 ▲6.42
Media Library /wp-admin/upload.php3.36 ▲0.1336.88 ▲0.15
Shortcode /wp-admin/admin.php?page=zpt-metals-info3.3231.43
Settings /wp-admin/admin.php?page=zpt-metals-settings3.4039.64

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for ZPT Metals
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.25 ▼0.021.74 ▲0.1437.95 ▼2.10
Dashboard /wp-admin2,222 ▲515.56 ▼0.0384.24 ▼3.7739.47 ▼4.40
Posts /wp-admin/edit.php2,127 ▲272.03 ▲0.0937.28 ▼4.4036.69 ▼0.59
Add New Post /wp-admin/post-new.php1,558 ▲3223.27 ▼0.16647.70 ▼44.7950.53 ▼7.47
Media Library /wp-admin/upload.php1,430 ▲304.19 ▼0.0396.55 ▼1.0042.36 ▼5.38
Shortcode /wp-admin/admin.php?page=zpt-metals-info9541.9922.0031.89
Settings /wp-admin/admin.php?page=zpt-metals-settings2,3779.96180.4165.77

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • zpt_metal_api_error_found
    • theysaidso_admin_options
    • widget_recent-comments

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
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/zpt-metals/backend/zpt-cron.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Screenshots: Screenshot #7 (Before and After product price) image required
The official readme.txt is a good inspiration

zpt-metals/igniter.php 85% from 13 tests

"ZPT Metals" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 285 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("zpt-metals.php" instead of "igniter.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 detected1,418 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP66081431,418

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.89
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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 files were detected