46% addressya-for-woocommerce

Code Review | ADDRESSYA

WordPress plugin ADDRESSYA scored46%from 54 tests.

About plugin

  • Plugin page: addressya-for-woo...
  • Plugin version: 3.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2021
  • Latest release: Mar 24, 2023
  • Number of updates: 18
  • Update frequency: every 36.2 days
  • Top authors: mariacheadle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,704 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.88MB] [CPU: ▼37.06ms] Passed 4 tests

Analyzing server-side resources used by ADDRESSYA
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.27 ▼4.53
Dashboard /wp-admin3.07 ▼0.2724.81 ▼40.64
Posts /wp-admin/edit.php3.07 ▼0.2827.59 ▼22.04
Add New Post /wp-admin/post-new.php3.07 ▼2.8223.72 ▼69.58
Media Library /wp-admin/upload.php3.07 ▼0.1623.00 ▼15.99
/wp-admin/admin.php?page=update-driver3.0733.29
Addressya /wp-admin/admin.php?page=addressya3.0723.08
Addressya Setting /wp-admin/admin.php?page=addressya-submenu33.0724.51
Driver /wp-admin/admin.php?page=driver3.0725.18
/wp-admin/admin.php?page=add-driver3.0733.30
Credit Application /wp-admin/admin.php?page=credit-app-map-view3.0727.17
/wp-admin/admin.php?page=credit-app-update3.0725.00
Addressya Login /wp-admin/admin.php?page=addressya-login3.0730.55

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ADDRESSYA
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲17913.53 ▼1.008.44 ▲6.4440.22 ▼8.00
Dashboard /wp-admin2,256 ▲885.54 ▲0.0183.10 ▼7.0887.28 ▲44.33
Posts /wp-admin/edit.php2,184 ▲872.04 ▲0.0239.03 ▲3.0439.90 ▲5.55
Add New Post /wp-admin/post-new.php1,754 ▲21724.59 ▲6.59734.88 ▲76.1466.54 ▲5.40
Media Library /wp-admin/upload.php1,473 ▲734.20 ▼0.02112.74 ▲14.8374.43 ▲29.71
/wp-admin/admin.php?page=update-driver3,5682.6241.0835.05
Addressya /wp-admin/admin.php?page=addressya280.420.303.61
Addressya Setting /wp-admin/admin.php?page=addressya-submenu39552.1524.5228.74
Driver /wp-admin/admin.php?page=driver1,6813.1958.4767.61
/wp-admin/admin.php?page=add-driver3,4502.3934.4928.28
Credit Application /wp-admin/admin.php?page=credit-app-map-view1,4873.2363.3632.04
/wp-admin/admin.php?page=credit-app-update1,1802.4535.8929.73
Addressya Login /wp-admin/admin.php?page=addressya-login9762.0424.6528.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_addressya_credit_application
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • addressya_plugin_version
    • theysaidso_admin_options
    • addressya_appearance_settings
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=addressya-login
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-driver
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-add-driver.php+204
    Undefined variable: post
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add-driver
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-add-driver.php+204
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/admin.php?page=update-driver
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-update-driver.php+185
    Undefined index: member_id
    • > GET request to /wp-admin/admin.php?page=credit-app-map-view
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > POST request to /wp-admin/admin-ajax.php?ver=652ed9f9dc8d8
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/class-addressya-admin-api.php+27
    Undefined index: access_token
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+1
    Undefined index: app
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+178
    Undefined variable: location_data
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+178
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+179
    Undefined variable: location_id
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+180
    Undefined variable: customer_id
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=credit-app-update
    • > Notice in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php+321
    Undefined index: order_id

SRP 0% 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
Almost there! Just fix the following items
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/addressya-for-woocommerce/views/html-checkout-verify-otp.php
    • > /wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php
    • > /wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-driver.php
    • > /wp-content/plugins/addressya-for-woocommerce/includes/admin/views/meta-boxes/html-creditapp-map-view.php
    • > /wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-settings-page.php
    • > /wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-add-driver.php
  • 26× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-add-driver.php:204
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 176
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 173
    • > PHP Notice
      Undefined variable: location_data in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 178
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/addressya-for-woocommerce/includes/admin/class-addressya-admin-cred-app.php on line 3
    • > PHP Notice
      Undefined variable: customer_id in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 180
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 176
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/meta-boxes/html-vehicle-add.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 176
    • > PHP Notice
      Undefined index: app in wp-content/plugins/addressya-for-woocommerce/includes/admin/views/admin-credit-app-update.php on line 1

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=addressya-login
    • > Javascript (severe) in unknown
    http://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css?ver=6.3.1 8:0 Uncaught SyntaxError: Unexpected token '.'
    • > GET request to /wp-admin/admin.php?page=update-driver
    • > Network (severe)
    wp-admin/admin-ajax.php?ver=652ed9eece0de&action=addressya_get_driver&member_id= - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/admin.php?page=addressya
    • > Network (severe)
    wp-admin/admin.php?page=addressya - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=credit-app-map-view
    • > Javascript (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key=AIzaSyAVF-NDUdl0nK6898LtgxQWX4_GlmtkOl8&callback=initMap&v=weekly 128:473 Uncaught dca: initMap is not a function
    • > GET request to /wp-admin/admin.php?page=driver
    • > Network (severe)
    wp-admin/admin-ajax.php?ver=652ed9f3e4a20&action=get_driver&status= - Failed to load resource: the server responded with a status of 400 (Bad Request)
    • > GET request to /wp-admin/admin.php?page=driver
    • > Console-api (warning) in unknown
    /wp-admin/admin.php?page=driver 277:24 Object

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: addressya, ecommerce, address, delivery, credit application

addressya-for-woocommerce/addressya.php 69% from 13 tests

The entry point to "ADDRESSYA" version 3.1.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("addressya-for-woocommerce.php" instead of "addressya.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 300 characters long)
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,253 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP387771,2364,505
JavaScript31951261,130
CSS2180518
SVG1122100

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity15.06
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods153
▷ Static methods4932.03%
▷ Public methods14796.08%
▷ Protected methods63.92%
▷ Private methods00.00%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected