90% lenses-prescription

Code Review | Lenses Prescription

WordPress plugin Lenses Prescription scored90%from 54 tests.

About plugin

  • Plugin page: lenses-prescription
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: Jan 22, 2020
  • Latest release: Mar 30, 2022
  • Number of updates: 3
  • Update frequency: every 266.0 days
  • Top authors: pektsekye (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,618 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.00MB] [CPU: ▼4.97ms] Passed 4 tests

An overview of server-side resources used by Lenses Prescription
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.13 ▼3.17
Dashboard /wp-admin3.31 ▲0.0044.98 ▼7.29
Posts /wp-admin/edit.php3.36 ▲0.0046.98 ▼0.86
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.34 ▼8.54
Media Library /wp-admin/upload.php3.23 ▲0.0035.04 ▲0.40

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Lenses Prescription
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.28 ▼1.101.95 ▼0.2538.22 ▼6.27
Dashboard /wp-admin2,206 ▲154.89 ▼0.0198.24 ▼10.0444.22 ▼5.18
Posts /wp-admin/edit.php2,089 ▲212.05 ▲0.0341.33 ▲5.7334.75 ▲0.22
Add New Post /wp-admin/post-new.php1,539 ▲2518.20 ▲0.65612.72 ▼78.8351.02 ▼31.69
Media Library /wp-admin/upload.php1,388 ▼04.11 ▼0.1495.97 ▲0.5140.20 ▼3.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: product options, prescription, contact lenses

lenses-prescription/lenses-prescription.php Passed 13 tests

This is the main PHP file of "Lenses Prescription" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
66 characters long description:
Displays product options as table for contact lenses prescription.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected426 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1216319386
JavaScript220032
CSS2508

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes111.11%
Methods44
▷ Static methods49.09%
▷ Public methods4090.91%
▷ Protected methods00.00%
▷ Private methods49.09%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
view/adminhtml/web/product/edit/dropdown_options.png95.13KB25.95KB▼ 72.72%