78% clicksco-offerstack

Code Review | OfferStack

WordPress plugin OfferStack scored78%from 54 tests.

About plugin

  • Plugin page: clicksco-offerstack
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Aug 30, 2018
  • Latest release: May 19, 2019
  • Number of updates: 7
  • Update frequency: every 38.7 days
  • Top authors: Furqan Freed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /591 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.04ms] Passed 4 tests

This is a short check of server-side resources used by OfferStack
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.71 ▲1.16
Dashboard /wp-admin3.31 ▲0.0152.45 ▲2.03
Posts /wp-admin/edit.php3.36 ▲0.0148.95 ▼0.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.29 ▼15.11
Media Library /wp-admin/upload.php3.24 ▲0.0142.47 ▲9.35

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

OfferStack: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8414.47 ▲0.172.11 ▲0.2039.64 ▼9.02
Dashboard /wp-admin2,224 ▲365.82 ▼0.08104.30 ▼2.1860.62 ▲20.32
Posts /wp-admin/edit.php2,104 ▲152.04 ▼0.0136.80 ▼0.2632.58 ▼3.14
Add New Post /wp-admin/post-new.php1,680 ▲15022.19 ▲3.91740.09 ▲123.1561.89 ▲8.69
Media Library /wp-admin/upload.php1,403 ▲214.12 ▼0.10102.09 ▼2.2043.70 ▲1.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/clicksco-offerstack/templates/theme-1.php
    • > /wp-content/plugins/clicksco-offerstack/templates/theme-default.php
  • 15× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 72
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 5
    • > PHP Notice
      Undefined variable: is_sidebar in wp-content/plugins/clicksco-offerstack/templates/theme-default.php on line 1
    • > PHP Notice
      Undefined variable: is_sidebar in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 72
    • > PHP Notice
      Undefined variable: is_sidebar in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 1
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/clicksco-offerstack/templates/theme-default.php on line 7
    • > PHP Warning
      array_slice() expects parameter 1 to be array, null given in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 5
    • > PHP Notice
      Undefined variable: max_iteams in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/clicksco-offerstack/templates/theme-default.php on line 5
    • > PHP Notice
      Undefined variable: offers_listing in wp-content/plugins/clicksco-offerstack/templates/theme-1.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: offers, clicksco, vouchers, deals

clicksco-offerstack/offerstack.php 92% from 13 tests

The entry point to "OfferStack" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("clicksco-offerstack.php" instead of "offerstack.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
There were no executable files found in this plugin4,898 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
JSON2003,749
Sass51184731
PHP55637272
JavaScript6241197
Markdown124041
YAML1006
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/assets/images/icon-256x256.png9.35KB7.78KB▼ 16.78%
resources/assets/images/icon-128x128.png4.92KB3.58KB▼ 27.34%
resources/assets/images/logo.png1.97KB0.23KB▼ 88.24%
public/images/logo.png1.97KB0.23KB▼ 88.24%