73% masoffer-promotion

Code Review | Masoffer Promotion

WordPress plugin Masoffer Promotion scored73%from 54 tests.

About plugin

  • Plugin page: masoffer-promotion
  • Plugin version: 2.1.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.2
  • WordPress version: 6.3.1
  • First release: Aug 1, 2019
  • Latest release: May 10, 2021
  • Number of updates: 28
  • Update frequency: every 23.2 days
  • Top authors: masoffer (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /1,885 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.20ms] Passed 4 tests

A check of server-side resources used by Masoffer Promotion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0748.51 ▲5.54
Dashboard /wp-admin3.37 ▲0.0248.85 ▼16.20
Posts /wp-admin/edit.php3.42 ▲0.0648.90 ▼2.12
Add New Post /wp-admin/post-new.php5.95 ▲0.0787.43 ▼12.82
Media Library /wp-admin/upload.php3.29 ▲0.0640.27 ▲2.34
MasOffer Promotion /wp-admin/options-general.php?page=masoffer-promotion-official3.2631.25

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Masoffer Promotion
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7214.34 ▼0.032.02 ▲0.2044.24 ▲1.04
Dashboard /wp-admin2,199 ▲185.48 ▼0.1985.56 ▼21.6341.47 ▲1.79
Posts /wp-admin/edit.php2,104 ▲41.98 ▼0.0133.11 ▼6.5039.71 ▼0.83
Add New Post /wp-admin/post-new.php1,531 ▲323.08 ▲0.03684.49 ▼7.8556.09 ▲2.24
Media Library /wp-admin/upload.php1,404 ▲74.17 ▼0.03106.30 ▼22.4546.44 ▼1.96
MasOffer Promotion /wp-admin/options-general.php?page=masoffer-promotion-official9681.9923.5538.93

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/masoffer-promotion/views/promotions.php
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/masoffer-promotion/views/admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/masoffer-promotion/masoffer-promotion.php:20
    • > PHP Notice
      Undefined variable: take in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2
    • > PHP Notice
      Undefined variable: orderby in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2
    • > PHP Notice
      Undefined variable: coupon in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2
    • > PHP Notice
      Undefined variable: offerid in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2
    • > PHP Notice
      Undefined variable: ordertype in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2
    • > PHP Notice
      Undefined variable: category in wp-content/plugins/masoffer-promotion/views/promotions.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=masoffer-promotion-official
    • > Rendering (warning) in unknown
    /wp-admin/options-general.php?page=masoffer-promotion-official 212 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: marketing, affiliate

masoffer-promotion/masoffer-promotion.php Passed 13 tests

The entry point to "Masoffer Promotion" version 2.1.4 is a PHP file that has certain tags in its header comment area
46 characters long description:
Plugin hỗ trợ hiển thị mã giảm giá

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin961 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP44828325
JavaScript2182254
CSS227216
Sass140166

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/fav_mo64.png3.87KB2.28KB▼ 41.22%
images/logo_post.png6.30KB6.30KB0.00%
images/mo2-300x51.png12.21KB6.37KB▼ 47.81%
fav_mo64.png3.87KB2.28KB▼ 41.22%
mo2-300x51.png12.21KB6.37KB▼ 47.81%