83% advanced-local-pickup-for-woocommerce

Code Review | Advanced Local Pickup for WooCommerce

WordPress plugin Advanced Local Pickup for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: advanced-local-pi...
  • Plugin version: 1.5.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Aug 7, 2023
  • Number of updates: 77
  • Update frequency: every 15.6 days
  • Top authors: zorem (93.51%)kuldipzorem (7.79%)

Code review

54 tests

User reviews

38 reviews

Install metrics

4,000+ active /79,570 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼7.86MB] [CPU: ▼1,621,630.36ms] Passed 4 tests

Analyzing server-side resources used by Advanced Local Pickup for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0845.27 ▲3.23
Dashboard /wp-admin3.42 ▼31.6553.85 ▼6,486,520.65
Posts /wp-admin/edit.php3.54 ▲0.1352.56 ▲4.66
Add New Post /wp-admin/post-new.php6.00 ▲0.0795.70 ▼8.68
Media Library /wp-admin/upload.php3.34 ▲0.0742.67 ▲4.85

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 71 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Local Pickup for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲3714.14 ▼0.581.68 ▼0.2043.71 ▼2.82
Dashboard /wp-admin2,204 ▲275.51 ▼0.1791.81 ▼1.7640.64 ▼9.49
Posts /wp-admin/edit.php2,110 ▲72.01 ▲0.0734.50 ▼3.4836.01 ▲1.80
Add New Post /wp-admin/post-new.php1,537 ▲1123.26 ▲0.16643.00 ▼46.9262.64 ▲7.34
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.0297.98 ▼6.9145.42 ▼1.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% 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 50% 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
Please fix the following
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/wclp-edit-location-form.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/templates/emails/plain/pickup-instruction.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/admin_footer_panel.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/admin_message_panel.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/wclp_locations_tab.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/wclp_setting_tab.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/templates/myaccount/pickup-instruction.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/wclp_pickup_location_instruction_preview.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_local_pickup() in wp-content/plugins/advanced-local-pickup-for-woocommerce/templates/emails/pickup-instruction.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses_post() in wp-content/plugins/advanced-local-pickup-for-woocommerce/include/views/wclp_addon_tab.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

advanced-local-pickup-for-woocommerce/woo-advanced-local-pickup.php 77% from 13 tests

The principal PHP file in "Advanced Local Pickup for WooCommerce" v. 1.5.5 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-local-pickup-for-woocommerce.php" instead of "woo-advanced-local-pickup.php")
  • Requires at least: Required version does not match the one declared in readme.txt ("5.0" instead of "4.0")
  • Description: Please keep the plugin description shorter than 140 characters (currently 145 characters long)

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
Everything looks great! No dangerous files found in this plugin9,568 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP185976254,042
CSS7418652,531
PO File77281,0581,710
JavaScript62041711,209
SVG41357
XML10019

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity66.43
▷ Minimum class complexity4.00
▷ Maximum class complexity311.00
Average method complexity5.53
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods101
▷ Static methods65.94%
▷ Public methods9897.03%
▷ Protected methods00.00%
▷ Private methods32.97%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
13 PNG files occupy 0.21MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cev-icon.png18.66KB2.33KB▼ 87.50%
include/customizer/dist/25570203a9df4725d87c.png8.75KB5.49KB▼ 37.33%
assets/images/ast-icon.png4.53KB2.38KB▼ 47.53%
assets/images/alp-logo.png12.82KB6.33KB▼ 50.67%
assets/images/alp-pro-icon.png46.09KB10.13KB▼ 78.03%