83% popup-anywhere

Code Review | Popup Anywhere

WordPress plugin Popup Anywhere scored83%from 54 tests.

About plugin

  • Plugin page: popup-anywhere
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 1, 2022
  • Latest release: Oct 1, 2022
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: mrlonganh (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /176 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼2.65ms] Passed 4 tests

This is a short check of server-side resources used by Popup Anywhere
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.15 ▲3.23
Dashboard /wp-admin3.41 ▲0.1146.49 ▼1.41
Posts /wp-admin/edit.php3.53 ▲0.1747.00 ▼2.24
Add New Post /wp-admin/post-new.php5.99 ▲0.1188.85 ▼6.82
Media Library /wp-admin/upload.php3.34 ▲0.1135.21 ▼0.11

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Popup Anywhere: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.77 ▼0.968.63 ▲6.8138.04 ▼7.24
Dashboard /wp-admin2,211 ▲345.62 ▼0.0285.18 ▼0.5038.39 ▼6.26
Posts /wp-admin/edit.php2,116 ▲161.97 ▼0.1938.44 ▲0.0334.18 ▲0.43
Add New Post /wp-admin/post-new.php1,549 ▲1418.13 ▲0.06615.54 ▼43.6568.69 ▲2.97
Media Library /wp-admin/upload.php1,416 ▲134.19 ▼0.0195.50 ▼1.8740.44 ▼3.18

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 15× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/popup-anywhere/template/render_image_popup_anywhere.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/popup-anywhere/template/render_external_popup_anywhere.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_types() in wp-content/plugins/popup-anywhere/core/options_popup_anywhere.php:20
    • > PHP Notice
      Undefined variable: popup_attr in wp-content/plugins/popup-anywhere/template/shortcode.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/popup-anywhere/template/shortcode.php:3
    • > PHP Notice
      Undefined variable: imageL in wp-content/plugins/popup-anywhere/template/render_image_popup_anywhere.php on line 10
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/popup-anywhere/template/shortcode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/popup-anywhere/jwext-popup-anywhere.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/popup-anywhere/template/render_content_popup_anywhere.php:3
    • > PHP Notice
      Undefined variable: popup_attr in wp-content/plugins/popup-anywhere/template/shortcode.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #4, #5 in popup-anywhere/assets to your readme.txt
Please take inspiration from this readme.txt

popup-anywhere/jwext-popup-anywhere.php 92% from 13 tests

Analyzing the main PHP file in "Popup Anywhere" version 1.0
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 ("popup-anywhere.php" instead of "jwext-popup-anywhere.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
Success! There were no dangerous files found in this plugin99,899 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
CSS442864,289
JavaScript47,79170734,721
PHP7168143820
PO File1252669

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity136.00
▷ Minimum class complexity136.00
▷ Maximum class complexity136.00
Average method complexity10.64
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.53MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
template/assets/images/jwext_overlay.png0.98KB0.09KB▼ 90.43%
template/assets/images/loading.png5.41KB2.98KB▼ 44.99%
template/assets/images/right.png0.30KB0.40KB0.00%
screenshot-1.png531.14KB141.71KB▼ 73.32%
template/assets/images/test.png1.90KB0.91KB▼ 52.24%