72% did-prestashop-display

Code Review | Did Prestashop Display - Show Prestashop products in your WordPress

WordPress plugin Did Prestashop Display - Show Prestashop products in your WordPress scored72%from 54 tests.

About plugin

  • Plugin page: did-prestashop-di...
  • Plugin version: 1.0.30
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-5.4
  • WordPress version: 6.3.1
  • First release: Aug 4, 2020
  • Latest release: Aug 5, 2020
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: didweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /977 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼4.71ms] Passed 4 tests

Analyzing server-side resources used by Did Prestashop Display - Show Prestashop products in your WordPress
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4742.97 ▲2.51
Dashboard /wp-admin3.62 ▲0.2749.03 ▼12.39
Posts /wp-admin/edit.php3.73 ▲0.3746.28 ▼0.24
Add New Post /wp-admin/post-new.php6.22 ▲0.3380.22 ▼8.70
Media Library /wp-admin/upload.php3.54 ▲0.3143.66 ▲9.99
Documentación /wp-admin/admin.php?page=prestashop-display-docuemntation3.5832.90
Did Prestashop /wp-admin/admin.php?page=prestashop-display3.5130.23
Get Pro /wp-admin/admin.php?page=prestashop-display-get-pro3.5829.60

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 53 new files
Database: no new tables, 21 new options
New WordPress options
didpd_n_domains
didpd_key_product
didpd_default_currency
didpd_url_buy
didpd_n_invoice
theysaidso_admin_options
didpd_default_domain
can_compress_scripts
widget_recent-posts
didpd_default_size_img
...

Browser metrics Passed 4 tests

Checking browser requirements for Did Prestashop Display - Show Prestashop products in your WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲19814.24 ▼0.167.88 ▲5.9825.72 ▼19.72
Dashboard /wp-admin2,225 ▲344.99 ▲0.12105.06 ▼10.1383.75 ▲40.54
Posts /wp-admin/edit.php2,126 ▲372.26 ▲0.2434.06 ▼1.6036.39 ▲1.41
Add New Post /wp-admin/post-new.php1,697 ▲16423.11 ▼0.15753.87 ▲72.1039.00 ▼14.92
Media Library /wp-admin/upload.php1,425 ▲404.37 ▲0.1195.11 ▼7.5579.55 ▲34.91
Documentación /wp-admin/admin.php?page=prestashop-display-docuemntation2,1211.8028.7061.68
Did Prestashop /wp-admin/admin.php?page=prestashop-display1,0041.8426.7643.42
Get Pro /wp-admin/admin.php?page=prestashop-display-get-pro1,3371.7727.2644.83

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 21 options in the database
    • can_compress_scripts
    • didpd_prices
    • didpd_default_type
    • didpd_default_button
    • didpd_default_size_img
    • didpd_domains_test
    • didpd_n_invoice
    • widget_theysaidso_widget
    • didpd_url_buy
    • didpd_default_with_taxes
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=prestashop-display
    • > Notice in wp-content/plugins/did-prestashop-display/templates/admin/didpd_admin_home.php+170
    Undefined index: languages
    • > GET request to /wp-admin/admin.php?page=prestashop-display
    • > Warning in wp-content/plugins/did-prestashop-display/templates/admin/didpd_admin_home.php+170
    Invalid argument supplied for foreach()

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
Please fix the following
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_category_a.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_error.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_home_a.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_category_b.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_b.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_home_b.php
    • > /wp-content/plugins/did-prestashop-display/did_prestashop_display.php
    • > /wp-content/plugins/did-prestashop-display/templates/public/didpd_model_a.php
  • 66× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: img_logo in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_home_a.php on line 6
    • > PHP Notice
      Undefined variable: values in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_a.php on line 10
    • > PHP Notice
      Undefined variable: current_atts in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_b.php on line 2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_error.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/did-prestashop-display/templates/admin/didpd_admin_home.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_alternate_home_a.php on line 26
    • > PHP Notice
      Undefined variable: values in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_a.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/did-prestashop-display/templates/admin/_parts/didpd_table_functions.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_a.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/did-prestashop-display/templates/public/didpd_model_a.php on line 12

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: products, links, banners, prestashop, marketing...

did-prestashop-display/did_prestashop_display.php 77% from 13 tests

"Did Prestashop Display - Show Prestashop products in your WordPress" version 1.0.30's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "4.9.6")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("did-prestashop-display.php" instead of "did_prestashop_display.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin16,629 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
CSS31,232159,183
JavaScript28513203,256
PO File41,2553,0362,170
PHP22516591,897
Bourne Shell12111123

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity23.50
▷ Minimum class complexity3.00
▷ Maximum class complexity43.00
Average method complexity3.90
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods31
▷ Static methods13.23%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.26MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/explicacion_shortcode.png55.28KB18.33KB▼ 66.84%
imgs/did-web.png0.74KB0.62KB▼ 16.45%
imgs/logo_did-web.png3.97KB2.44KB▼ 38.56%
imgs/diamond_25.png1.19KB1.25KB0.00%
assets/banner-772x250.png74.08KB19.50KB▼ 73.68%