10% aliprice

Code Review | AliPrice

WordPress plugin AliPrice scored 10% from 54 tests.

About plugin

  • Plugin page: aliprice
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.7.4
  • WordPress version: 5.8.1
  • First release: Aug 2, 2017
  • Latest release: Aug 2, 2017
  • Number of updates: 10
  • Update frequency: every 0.7 days
  • Top authors: aliprice (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active / 6,628 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/aliprice/core/class.AliExpress.Request2.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; AliExpressJSONAPI2 has a deprecated constructor

Server metrics [RAM: ▼1.64MB] [CPU: ▼191.46ms] Passed 4 tests

This is a short check of server-side resources used by AliPrice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.99 ▼0.735.75 ▼15.90
Dashboard /wp-admin2.01 ▼1.056.31 ▼39.49
Posts /wp-admin/edit.php2.01 ▼1.106.05 ▼43.13
Add New Post /wp-admin/post-new.php2.01 ▼3.426.81 ▼647.60
Media Library /wp-admin/upload.php2.01 ▼1.006.09 ▼35.60
Categories /wp-admin/edit-tags.php?taxonomy=shopcategory&post_type=products2.016.25
All Items /wp-admin/edit.php?post_type=products2.017.53
Add new /wp-admin/post-new.php?post_type=products2.017.41

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 1,000 new files
Database: 2 new tables, 4 new options
New tables
wp_aliprice_product_review
wp_aliprice_products
New WordPress options
current_theme
AL1
theme_mods_AL1
theme_switched

Browser metrics Passed 4 tests

This is an overview of browser requirements for AliPrice
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,472 ▼12415.91 ▲0.347.95 ▼1.803.84 ▼44.44
Dashboard /wp-admin2,981 ▲475.93 ▼0.06161.29 ▲7.74121.88 ▲9.75
Posts /wp-admin/edit.php2,897 ▲1582.72 ▲0.0079.73 ▲8.83163.47 ▲72.87
Add New Post /wp-admin/post-new.php1,761 ▲7819.47 ▲1.08326.69 ▼110.6191.70 ▼31.58
Media Library /wp-admin/upload.php1,910 ▲1035.06 ▲0.04149.69 ▼21.89137.67 ▲10.27
Categories /wp-admin/edit-tags.php?taxonomy=shopcategory&post_type=products2,0092.7178.69124.77
All Items /wp-admin/edit.php?post_type=products1,6442.8870.3772.52
Add new /wp-admin/post-new.php?post_type=products3,8869.29274.44178.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/aliprice/core/class.AliExpress.Request2.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; AliExpressJSONAPI2 has a deprecated constructor
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_aliprice_product_review
    • wp_aliprice_products
  • Zombie WordPress options detected upon uninstall: 4 options
    • AL1
    • theme_switched
    • current_theme
    • theme_mods_AL1

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/aliprice/core/class.AliExpress.Request2.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; AliExpressJSONAPI2 has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/aliprice/core/class.AliExpress.insertAPI.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; AliExpressInsert has a deprecated constructor
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/aliprice/core/class.Products.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; AEProducts has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > User notice in wp-includes/functions.php+5663
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > Warning in wp-content/plugins/aliprice/core/init.php+378
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/post-new.php?post_type=products
    • > Warning in wp-content/plugins/aliprice/core/init.php+384
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/aliprice/templates/AL1/templates/gallery.php
  • 300× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: attachments in wp-content/plugins/aliprice/templates/AL1/templates/gallery.php on line 1
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/aliprice/templates/AL2/widgets/aliproducts/products.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'AEProducts' not found in wp-content/plugins/aliprice/templates/AL1/templates/products-special.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/aliprice/core/shortcodes.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/aliprice/templates/AL2/customize/images.php:91
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/aliprice/templates/AL2/products.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/aliprice/templates/AL1/templates/dynamic-css.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/aliprice/libs/Requests/Requests/Exception/HTTP/502.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/aliprice/templates/AL1/home.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/aliprice/templates/AL3/header.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: aliprice, aliexpress, product

aliprice/aliprice.php Passed 13 tests

The main PHP script in "AliPrice" version 1.0 is automatically included on every request by WordPress
71 characters long description:
AliPrice is a WordPress plugin created for AliExpress Affiliate Program

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
Good job! No executable or dangerous file extensions detected83,851 lines of code in 352 files:
LanguageFilesBlank linesComment linesLines of code
CSS236,59810629,595
PO File3112,12517,92624,615
PHP2244,4434,63320,353
JavaScript668262398,502
SVG300603
Markdown1370118
HTML427065

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity18.06
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces4
Traits0
Classes77
▷ Abstract classes00.00%
▷ Concrete classes77100.00%
▷ Final classes00.00%
Methods540
▷ Static methods488.89%
▷ Public methods44482.22%
▷ Protected methods488.89%
▷ Private methods488.89%
Functions267
▷ Named functions267100.00%
▷ Anonymous functions00.00%
Constants33
▷ Global constants1545.45%
▷ Class constants1854.55%
▷ Public constants18100.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
44 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
img/logoali.png5.07KB2.46KB▼ 51.38%
img/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%
templates/AL3/public/images/logo.png1.66KB1.74KB0.00%
templates/AL1/public/images/logof.png0.93KB0.94KB0.00%