10% offers-popup

Code Review | Offer Popup

WordPress plugin Offer Popup scored 10% from 54 tests.

About plugin

  • Plugin page: offers-popup
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Feb 18, 2014
  • Latest release: Dec 27, 2016
  • Number of updates: 15
  • Update frequency: every 69.5 days
  • Top authors: dswpsupport (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

40+ active / 4,002 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/offers-popup/offers.php+87
    Undefined index: action

Server metrics [RAM: ▼1.92MB] [CPU: ▼50.75ms] Passed 4 tests

A check of server-side resources used by Offer Popup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.398.66 ▼38.12
Dashboard /wp-admin2.09 ▼1.227.18 ▼41.43
Posts /wp-admin/edit.php2.09 ▼1.276.81 ▼41.22
Add New Post /wp-admin/post-new.php2.09 ▼3.805.80 ▼82.21
Media Library /wp-admin/upload.php2.09 ▼1.146.62 ▼26.19

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: 1 new table, 6 new options
New tables
wp_offers
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

Offer Popup: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲17513.61 ▼0.974.67 ▲2.6238.82 ▼8.88
Dashboard /wp-admin2,245 ▲575.92 ▲1.0496.00 ▼21.5640.55 ▼3.80
Posts /wp-admin/edit.php2,128 ▲392.08 ▲0.0737.11 ▲2.4033.46 ▼4.16
Add New Post /wp-admin/post-new.php1,549 ▲3023.17 ▼0.32597.80 ▼91.1351.18 ▼2.81
Media Library /wp-admin/upload.php1,427 ▲394.26 ▲0.0595.20 ▼17.5442.50 ▼5.38
Add New Offer /wp-admin/offers_admin.php?page=offers_add_offer260.440.1212.14
Offers Widget /wp-admin/offers_admin.php260.440.116.59

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
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/offers-popup/offers.php+87
    Undefined index: action
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 12× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/offers-popup/offers.php:40
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/offers-popup/new_offers.php:7
    • > PHP Notice
      Undefined variable: offer_detail in wp-content/plugins/offers-popup/manage_offer.php on line 4
    • > PHP Notice
      Undefined index: info in wp-content/plugins/offers-popup/offers_admin.php on line 3
    • > PHP Notice
      Undefined index: orderby in wp-content/plugins/offers-popup/offers_admin.php on line 14
    • > PHP Notice
      Undefined index: order in wp-content/plugins/offers-popup/offers_admin.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/offers-popup/offers_admin.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_editor() in wp-content/plugins/offers-popup/manage_offer.php:74
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/offers-popup/manage_offer.php on line 4
    • > PHP Notice
      Undefined variable: offer_detail in wp-content/plugins/offers-popup/manage_offer.php on line 46

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/offers_admin.php?page=offers_add_offer
    • > Network (severe)
    wp-admin/offers_admin.php?page=offers_add_offer - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/offers_admin.php
    • > Network (severe)
    wp-admin/offers_admin.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
The official readme.txt might help

offers-popup/offers.php 92% from 13 tests

This is the main PHP file of "Offer Popup" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("offers-popup.php" instead of "offers.php")

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
No dangerous file extensions were detected798 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS22854393
PHP4309348
JavaScript16057

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-icons_888888_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%