63% masoffer-product-listing

Code Review | Masoffer Product Listing

WordPress plugin Masoffer Product Listing scored63%from 54 tests.

About plugin

  • Plugin page: masoffer-product-...
  • Plugin version: 1.2.8
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6
  • WordPress version: 6.3.1
  • First release: Jun 9, 2020
  • Latest release: Jul 15, 2021
  • Number of updates: 23
  • Update frequency: every 17.4 days
  • Top authors: masoffer (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /1,613 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
Install script ran successfully

Server metrics [RAM: ▼0.62MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by Masoffer Product Listing
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2550.37 ▲15.22
Dashboard /wp-admin3.35 ▲0.0156.34 ▼4.66
Posts /wp-admin/edit.php3.47 ▲0.1155.95 ▲13.77
Add New Post /wp-admin/post-new.php3.23 ▼2.6645.98 ▼38.86
Media Library /wp-admin/upload.php3.28 ▲0.0547.36 ▲13.16
Shortcode /wp-admin/admin.php?page=mo-prod-page-short-code3.2238.29
Edit Shortcode /wp-admin/admin.php?page=mo-prod-page-edit-short-code3.2240.45
Add Shortcode /wp-admin/admin.php?page=mo-prod-page-add-short-code3.2539.81
Settings /wp-admin/admin.php?page=mo-prod-page-settings3.2538.27

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 43 new files
Database: 2 new tables, 8 new options
New tables
wp_mo_product_listing_url
wp_mo_product_listing_shortcode
New WordPress options
widget_theysaidso_widget
mo_prod_data_option_version
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
mo_prod_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Masoffer Product Listing
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.35 ▼0.201.73 ▲0.2340.44 ▼0.13
Dashboard /wp-admin2,222 ▲425.57 ▼0.0587.08 ▲4.5462.45 ▲26.80
Posts /wp-admin/edit.php2,127 ▲272.00 ▼0.0133.34 ▼2.2135.50 ▲4.46
Add New Post /wp-admin/post-new.php1,568 ▲4223.52 ▲0.07747.50 ▲92.2947.74 ▼22.21
Media Library /wp-admin/upload.php1,433 ▲394.12 ▼0.0996.20 ▲0.5175.15 ▲30.26
Shortcode /wp-admin/admin.php?page=mo-prod-page-short-code9752.0726.7326.37
Edit Shortcode /wp-admin/admin.php?page=mo-prod-page-edit-short-code7862.0122.4923.66
Add Shortcode /wp-admin/admin.php?page=mo-prod-page-add-short-code9982.0728.2324.81
Settings /wp-admin/admin.php?page=mo-prod-page-settings9691.9921.1825.38

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_mo_product_listing_shortcode
    • wp_mo_product_listing_url
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • mo_prod_data_option_version
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • mo_prod_db_version
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mo-prod-page-edit-short-code
    • > Notice in wp-content/plugins/masoffer-product-listing/masoffer-product-listing.php+493
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=mo-prod-page-short-code
    • > Notice in wp-content/plugins/masoffer-product-listing/masoffer-product-listing.php+462
    Undefined index: delete
    • > GET request to /wp-admin/admin.php?page=mo-prod-page-short-code
    • > Notice in wp-content/plugins/masoffer-product-listing/masoffer-product-listing.php+1047
    Undefined index: s
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mo-prod-page-add-short-code
    • > Notice in wp-content/plugins/masoffer-product-listing/views/add_short_code.php+50
    Undefined variable: data
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mo-prod-page-add-short-code
    • > Notice in wp-content/plugins/masoffer-product-listing/views/add_short_code.php+50
    Trying to access array offset on value of type null

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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/masoffer-product-listing/views/products.php
    • > /wp-content/plugins/masoffer-product-listing/views/add_short_code.php
    • > /wp-content/plugins/masoffer-product-listing/views/edit_short_code.php
  • 68× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: shortcodeInfo in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 85
    • > PHP Notice
      Undefined variable: dataOption in wp-content/plugins/masoffer-product-listing/views/add_short_code.php on line 66
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/masoffer-product-listing/views/short_code.php:15
    • > PHP Notice
      Undefined variable: dataOption in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 77
    • > PHP Notice
      Undefined variable: dataOption in wp-content/plugins/masoffer-product-listing/views/add_short_code.php on line 59
    • > PHP Notice
      Undefined variable: dataOption in wp-content/plugins/masoffer-product-listing/views/add_short_code.php on line 62
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 70
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/masoffer-product-listing/views/edit_short_code.php on line 85

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 Passed 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
2 plugin tags: affiliate, marketing

masoffer-product-listing/masoffer-product-listing.php Passed 13 tests

The entry point to "Masoffer Product Listing" version 1.2.8 is a PHP file that has certain tags in its header comment area
43 characters long description:
Plugin hỗ trợ hiển thị sản phẩm

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected5,820 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS51,063194,307
PHP71772591,018
JavaScript7257339
Sass140156

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity61.50
▷ Minimum class complexity16.00
▷ Maximum class complexity107.00
Average method complexity3.62
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods4595.74%
▷ Protected methods00.00%
▷ Private methods24.26%
Functions6
▷ Named functions00.00%
▷ Anonymous functions6100.00%
Constants27
▷ Global constants00.00%
▷ Class constants27100.00%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon_shopee-vn.png0.61KB0.68KB0.00%
mo2-300x51.png12.21KB6.37KB▼ 47.81%
images/mo2-300x51.png12.21KB6.37KB▼ 47.81%
fav_mo64.png3.87KB2.28KB▼ 41.22%
images/fav_mo20.png0.91KB0.96KB0.00%