57% 3d-printing-quote-calculator-by-phanes

Code Review | Phanes 3DP Calculator - Legacy

WordPress plugin Phanes 3DP Calculator - Legacy scored 57% from 54 tests.

About plugin

  • Plugin page: 3d-printing-quote...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.3
  • WordPress version: 5.9.2
  • First release: Feb 17, 2017
  • Latest release: Jan 16, 2021
  • Number of updates: 78
  • Update frequency: every 18.4 days
  • Top authors: phanesco (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 2,984 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼290.45ms] Passed 4 tests

Analyzing server-side resources used by Phanes 3DP Calculator - Legacy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1165.73 ▲16.14
Dashboard /wp-admin3.54 ▲0.1438.36 ▼7.94
Posts /wp-admin/edit.php3.78 ▲0.1444.17 ▲4.90
Add New Post /wp-admin/post-new.php7.07 ▲0.11100.50 ▼1,158.88
Media Library /wp-admin/upload.php3.49 ▲0.1927.79 ▲0.11
License code /wp-admin/admin.php?page=pqc-license-page3.4326.58
/wp-admin/admin.php?page=pqc-start3.4536.32
Settings /wp-admin/admin.php?page=pqc-settings-page3.4725.93
Orders /wp-admin/edit.php?post_type=pqc_order3.5531.80
Materials /wp-admin/admin.php?page=pqc-materials-page3.4629.07
Shipping Options /wp-admin/edit.php?post_type=pqc_shipping_option3.5528.60
Coupons /wp-admin/edit.php?post_type=pqc_coupon3.5528.01
/wp-admin/admin.php?page=pqc-about3.4327.07

Server storage [IO: ▲2.56MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 200 new files
Database: 2 new tables, 4 new options
New tables
wp_pqc_data
wp_pqc_materials
New WordPress options
pqc-version
pqc-options
pqc-rewrite-flush
pqc-license

Browser metrics Passed 4 tests

A check of browser resources used by Phanes 3DP Calculator - Legacy
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,068 ▲32617.78 ▲2.2219.42 ▲13.362.31 ▲0.26
Dashboard /wp-admin3,019 ▲1616.23 ▲0.06120.54 ▼14.40187.75 ▲29.32
Posts /wp-admin/edit.php2,813 ▲1223.24 ▲0.0165.37 ▲1.32147.98 ▲5.92
Add New Post /wp-admin/post-new.php1,743 ▲8219.72 ▲3.24394.19 ▲1.69198.49 ▲50.09
Media Library /wp-admin/upload.php1,827 ▲1325.67 ▲0.15126.06 ▼13.47206.66 ▲11.88
License code /wp-admin/admin.php?page=pqc-license-page1,2003.4568.91139.64
/wp-admin/admin.php?page=pqc-start1,2583.2363.82201.49
Settings /wp-admin/admin.php?page=pqc-settings-page1,5233.3164.64130.97
Orders /wp-admin/edit.php?post_type=pqc_order1,5543.7369.76116.12
Materials /wp-admin/admin.php?page=pqc-materials-page1,9473.5667.49166.94
Shipping Options /wp-admin/edit.php?post_type=pqc_shipping_option1,4983.7470.82122.36
Coupons /wp-admin/edit.php?post_type=pqc_coupon1,5883.7467.30118.57
/wp-admin/admin.php?page=pqc-about1,1293.1862.90169.86

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_pqc_materials
    • wp_pqc_data
  • The uninstall procedure has failed, leaving 4 options in the database
    • pqc-rewrite-flush
    • pqc-version
    • pqc-options
    • pqc-license

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/frontend.php
    • > /wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/build.php
    • > /wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/backend.php
  • 110× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\StripeObject' not found in wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/lib/AttachedObject.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/templates/checkout.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/templates/backend/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/lib/SubscriptionItem.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/admin/templates/welcome/about.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/tests/InvoiceTest.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/admin/templates/settings/paypal.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/admin/templates/welcome/header.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/3d-printing-quote-calculator-by-phanes/admin/templates/settings/general.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/lib/Dispute.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Add descriptions for screenshots #1, #10, #11, #12, #13, #14, #15, #2, #3, #4, #5, #6, #7, #8, #9 in 3d-printing-quote-calculator-by-phanes/assets to your readme.txt
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
You can look at the official readme.txt

3d-printing-quote-calculator-by-phanes/init.php 69% from 13 tests

The main PHP script in "Phanes 3DP Calculator - Legacy" version 1.1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 169 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("3d-printing-quote-calculator-by-phanes.php" instead of "init.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/i18n/languages/")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/3d-printing-quote-calculator-by-phanes/core/lib/stripe/data/ca-certificates.crt
21,393 lines of code in 166 files:
LanguageFilesBlank linesComment linesLines of code
PHP1393,6862,96011,622
JavaScript129759415,042
SVG2002,695
CSS5204561,618
Markdown32290332
JSON10036
XML20030
YAML23018

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.34
▷ Minimum class complexity1.00
▷ Maximum class complexity253.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces5
Interfaces3
Traits0
Classes111
▷ Abstract classes54.50%
▷ Concrete classes10695.50%
▷ Final classes65.66%
Methods627
▷ Static methods15725.04%
▷ Public methods54386.60%
▷ Protected methods233.67%
▷ Private methods619.73%
Functions33
▷ Named functions2781.82%
▷ Anonymous functions618.18%
Constants37
▷ Global constants2670.27%
▷ Class constants1129.73%
▷ Public constants11100.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
16 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui-base/images/ui-icons_444444_256x240.png6.92KB4.18KB▼ 39.61%
core/lib/stripe/data/test.png0.09KB0.09KB0.00%
assets/images/delete.png0.55KB0.30KB▼ 45.00%
assets/images/notification.png0.66KB0.42KB▼ 37.08%
assets/images/check-sign.png0.70KB0.45KB▼ 35.62%