68% ambi-products

Code Review | AmbiProducts

WordPress plugin AmbiProducts scored68%from 54 tests.

About plugin

  • Plugin page: ambi-products
  • Plugin version: 1.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2019
  • Latest release: Aug 7, 2019
  • Number of updates: 6
  • Update frequency: every 0.8 days
  • Top authors: zameelamjed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /601 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼19.49ms] Passed 4 tests

Analyzing server-side resources used by AmbiProducts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.34 ▼1.89
Dashboard /wp-admin3.28 ▼0.0231.57 ▼22.16
Posts /wp-admin/edit.php3.36 ▼0.0038.43 ▼9.63
Add New Post /wp-admin/post-new.php5.54 ▼0.3473.93 ▼35.55
Media Library /wp-admin/upload.php3.25 ▲0.0227.89 ▼10.62
Ambi Products /wp-admin/plugins.php?page=my-setting-admin3.2733.34
Ambi Products Settings /wp-admin/options-general.php?page=my-setting-admin-key3.2728.96

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: 1 new table, 6 new options
New tables
wp_ambi_products
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for AmbiProducts
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,950 ▲20415.11 ▲0.841.74 ▲0.0741.98 ▲1.11
Dashboard /wp-admin2,359 ▲1716.46 ▲1.57135.09 ▲27.5342.96 ▼1.03
Posts /wp-admin/edit.php2,265 ▲1793.51 ▲1.5056.29 ▲15.0637.42 ▼2.99
Add New Post /wp-admin/post-new.php1,539 ▲1823.12 ▲0.10614.16 ▼57.7234.35 ▼22.41
Media Library /wp-admin/upload.php1,404 ▲134.15 ▼0.0380.58 ▼27.1442.26 ▼8.52
Ambi Products /wp-admin/plugins.php?page=my-setting-admin1,0963.1347.6826.77
Ambi Products Settings /wp-admin/options-general.php?page=my-setting-admin-key9903.0439.3428.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_ambi_products
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=my-setting-admin-key
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
    • > GET request to /wp-admin/plugins.php?page=my-setting-admin
    • > Notice in wp-content/plugins/ambi-products/Ambi_Products_Options.php+214
    Trying to access array offset on value of type bool

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 take a closer look at the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ambi-products/Ambi_Products_Keys.php:143
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ambi-products/ambi_products.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ambi-products/Ambi_Display_Products.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ambi-products/Ambi_Products_Options.php:269
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ambi-products/Ambi_Add_Products.php:4

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 on the user side

Optimizations

Plugin configuration 96% from 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
8 plugin tags: map markers, geotag, list products, products table, coordinates...

ambi-products/ambi_products.php 92% from 13 tests

The principal PHP file in "AmbiProducts" v. 1.5 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ambi-products.php" instead of "ambi_products.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected959 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP7101151648
JavaScript2429262
Markdown116048
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.25
▷ Minimum class complexity6.00
▷ Maximum class complexity20.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
No PNG images were found in this plugin