10% eyewear-prescription-form

Code Review | Eyewear prescription form

WordPress plugin Eyewear prescription form scored10%from 54 tests.

About plugin

  • Plugin page: eyewear-prescript...
  • Plugin version: 4.0.11
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: May 24, 2020
  • Latest release: Oct 1, 2023
  • Number of updates: 50
  • Update frequency: every 24.5 days
  • Top authors: dugudlabs (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

60+ active /4,901 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
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/eyewear-prescription-form/includes/class-eyewear_prescription_form-activator.php+39
    Undefined variable: create_table_query

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.22ms] Passed 4 tests

A check of server-side resources used by Eyewear prescription form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1844.30 ▼4.46
Dashboard /wp-admin3.56 ▲0.2660.33 ▲3.10
Posts /wp-admin/edit.php3.62 ▲0.2657.28 ▲4.22
Add New Post /wp-admin/post-new.php6.08 ▲0.2087.02 ▼23.73
Media Library /wp-admin/upload.php3.41 ▲0.1841.96 ▲8.88

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 66 new files
Database: 1 new table, 6 new options
New tables
wp_epf_fields
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Eyewear prescription form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲21814.77 ▲0.391.84 ▼0.2643.96 ▼1.74
Dashboard /wp-admin2,373 ▲1886.51 ▲0.60130.80 ▲20.0438.33 ▼5.70
Posts /wp-admin/edit.php2,286 ▲1973.43 ▲1.3852.13 ▲10.8131.00 ▼6.49
Add New Post /wp-admin/post-new.php1,694 ▲16122.37 ▼0.92650.35 ▼72.8938.74 ▼26.87
Media Library /wp-admin/upload.php1,425 ▲374.19 ▼0.0382.80 ▼26.3142.42 ▼3.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_epf_fields
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

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

SRP 0% 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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/eyewear-prescription-form/public/partials/eyewear_prescription_form-public-display.php
    • > /wp-content/plugins/eyewear-prescription-form/public/partials/measure_my_pd.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/eyewear-prescription-form/admin/partials/eyewear_prescription_form-admin-display-product-page-visibility-rule-box.php:12
    • > PHP Fatal error
      Uncaught Error: Call to a member function show_errors() on null in wp-content/plugins/eyewear-prescription-form/public/partials/eyewear_prescription_form-public-multi-form-summary.php:15
    • > PHP Fatal error
      Uncaught Error: Call to a member function show_errors() on null in wp-content/plugins/eyewear-prescription-form/admin/partials/eyewear_prescription_form-admin-navbar.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_attachment_url() in wp-content/plugins/eyewear-prescription-form/public/partials/eyewear_prescription_form-public-multi-form-cat.php:543
    • > PHP Fatal error
      Uncaught Error: Call to a member function show_errors() on null in wp-content/plugins/eyewear-prescription-form/public/partials/eyewear_prescription_form-public-advanced.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_terms() in wp-content/plugins/eyewear-prescription-form/admin/partials/eyewear_prescription_form-admin-display.php:200

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

eyewear-prescription-form/eyewear_prescription_form.php 85% from 13 tests

"Eyewear prescription form" version 4.0.11's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("eyewear-prescription-form.php" instead of "eyewear_prescription_form.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin13,753 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
CSS31,101389,124
PHP192756582,320
JavaScript91331122,123
PO File167180146
SVG10140

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
21 PNG files occupy 0.47MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) admin/partials/images/upload-1.png20.94KB0.00KB▼ 100.00%
public/partials/images/coatingType.png28.26KB8.49KB▼ 69.97%
public/partials/images/upload.png3.15KB2.08KB▼ 34.10%
admin/partials/images/coatingType.png28.26KB8.49KB▼ 69.97%
public/partials/images/no_priscription.png4.58KB2.43KB▼ 46.97%