84% simple-push-subscribe-button

Code Review | Push7 Subscribe button

WordPress plugin Push7 Subscribe button scored 84% from 54 tests.

About plugin

  • Plugin page: simple-push-subsc...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.7
  • WordPress version: 5.8.1
  • First release: Mar 2, 2016
  • Latest release: Sep 19, 2016
  • Number of updates: 21
  • Update frequency: every 19.0 days
  • Top authors: hnle (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,683 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼154.32ms] Passed 4 tests

Server-side resources used by Push7 Subscribe button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1436.99 ▲9.34
Dashboard /wp-admin3.09 ▲0.0447.28 ▼0.35
Posts /wp-admin/edit.php3.18 ▲0.0745.40 ▼2.71
Add New Post /wp-admin/post-new.php5.45 ▲0.0194.31 ▼610.48
Media Library /wp-admin/upload.php3.03 ▲0.0332.27 ▼3.73
Push7 Buttons /wp-admin/options-general.php?page=push7-ssb3.0030.11

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 1 new option
New WordPress options
widget_push7-subscribe

Browser metrics Passed 4 tests

Push7 Subscribe button: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11415.78 ▲0.267.37 ▼6.1547.98 ▲0.46
Dashboard /wp-admin2,972 ▲415.91 ▼0.21161.58 ▲20.61111.40 ▲1.13
Posts /wp-admin/edit.php2,744 ▲52.70 ▲0.0163.96 ▼6.9194.91 ▲0.45
Add New Post /wp-admin/post-new.php1,673 ▼1019.13 ▲4.67376.01 ▼125.04115.09 ▼2.39
Media Library /wp-admin/upload.php1,812 ▲25.01 ▼0.02153.65 ▲3.53117.15 ▼11.07
Push7 Buttons /wp-admin/options-general.php?page=push7-ssb1,1382.6174.5788.07

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_push7-subscribe

Smoke tests 75% 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 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-push-subscribe-button/push7-subscribe-button.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: web push, push notification, notifications, desktop notifications

simple-push-subscribe-button/push7-subscribe-button.php 85% from 13 tests

"Push7 Subscribe button" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("simple-push-subscribe-button.php" instead of "push7-subscribe-button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin1,152 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP9208545646
CSS4220158
Sass3181105
JavaScript402292
TypeScript2252990
Markdown139061

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.22
▷ Minimum class complexity2.00
▷ Maximum class complexity19.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes225.00%
Methods64
▷ Static methods1523.44%
▷ Public methods5484.38%
▷ Protected methods11.56%
▷ Private methods914.06%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/smart-push7.png2.14KB2.11KB▼ 1.19%