68% popup4phone

Code Review | Popup4Phone

WordPress plugin Popup4Phone scored 68% from 54 tests.

About plugin

  • Plugin page: popup4phone
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.3
  • WordPress version: 5.8.1
  • First release: Jan 1, 2016
  • Latest release: Feb 9, 2020
  • Number of updates: 31
  • Update frequency: every 48.5 days
  • Top authors: ivanweb (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active / 9,466 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼141.60ms] Passed 4 tests

This is a short check of server-side resources used by Popup4Phone
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.1359.43 ▲17.51
Dashboard /wp-admin3.19 ▲0.1351.21 ▲4.56
Posts /wp-admin/edit.php3.24 ▲0.1349.45 ▲1.34
Add New Post /wp-admin/post-new.php5.48 ▲0.0596.85 ▼573.36
Media Library /wp-admin/upload.php3.07 ▲0.0735.81 ▲1.05
Integrations /wp-admin/admin.php?page=popup4phone-integrations3.3334.70
Leads /wp-admin/admin.php?page=popup4phone3.0741.60
Help /wp-admin/admin.php?page=popup4phone-help3.0926.95
Settings /wp-admin/admin.php?page=popup4phone-settings3.1032.62

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 41 new files
Database: 1 new table, 1 new option
New tables
wp_popup4phone_leads
New WordPress options
popup4phone_version

Browser metrics Passed 4 tests

Checking browser requirements for Popup4Phone
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,110 ▲53816.61 ▲1.0327.91 ▲16.9054.98 ▲5.55
Dashboard /wp-admin3,016 ▲825.92 ▼0.04151.90 ▼0.14113.07 ▼4.85
Posts /wp-admin/edit.php2,785 ▲462.71 ▲0.0071.27 ▼0.1998.99 ▲4.72
Add New Post /wp-admin/post-new.php1,624 ▲4318.78 ▲1.09399.64 ▼12.78112.98 ▼10.14
Media Library /wp-admin/upload.php1,856 ▲495.05 ▲0.02161.26 ▼5.56123.83 ▼1.40
Integrations /wp-admin/admin.php?page=popup4phone-integrations1,0602.0858.9171.16
Leads /wp-admin/admin.php?page=popup4phone1,3782.1363.9774.58
Help /wp-admin/admin.php?page=popup4phone-help1,2372.0962.60105.67
Settings /wp-admin/admin.php?page=popup4phone-settings1,2042.0961.80106.80

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_popup4phone_leads
  • Zombie WordPress options detected upon uninstall: 1 option
    • popup4phone_version

Smoke tests 50% 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)
Even though everything seems fine, this is not an exhaustive test

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 fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/popup4phone/templates/ga.tpl.php
    • > /wp-content/plugins/popup4phone/templates/popover-button-icon.php
    • > /wp-content/plugins/popup4phone/templates/admin/web-stat.tpl.php
  • 17× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: ws_flds in wp-content/plugins/popup4phone/templates/admin/web-stat.tpl.php on line 13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popup4phone/templates/_form-general.tpl.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/popup4phone/templates/admin/help.tpl.php:3
    • > PHP Notice
      Undefined variable: ga_id in wp-content/plugins/popup4phone/templates/ga.tpl.php on line 7
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/popup4phone/templates/admin/web-stat.tpl.php on line 10
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/popup4phone/templates/admin/web-stat.tpl.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/popup4phone/popup4phone.php:23
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popup4phone/templates/admin/admin_header.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popup4phone/templates/form-inline.tpl.php:6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/popup4phone/templates/form-popup.tpl.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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 require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
You can take inspiration from this readme.txt

popup4phone/popup4phone.php Passed 13 tests

"Popup4Phone" version 1.3.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
60 characters long description:
Popover/popup dialog for collecting the user`s phone numbers

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin4,813 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP276416252,908
PO File44204411,005
CSS48212573
JavaScript17214327

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity20.57
▷ Minimum class complexity1.00
▷ Maximum class complexity121.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes428.57%
▷ Concrete classes1071.43%
▷ Final classes00.00%
Methods163
▷ Static methods00.00%
▷ Public methods14287.12%
▷ Protected methods2112.88%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants15
▷ Global constants16.67%
▷ Class constants1493.33%
▷ Public constants14100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected