72% push-notifications-by-shops2apps

Code Review | Push Notifications by Shops2Apps

WordPress plugin Push Notifications by Shops2Apps scored 72% from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.4
  • WordPress version: 6.3.1
  • First release: Dec 23, 2015
  • Latest release: Dec 23, 2015
  • Number of updates: 2
  • Update frequency: every 1.5 days
  • Top authors: shops2apps (100%)

Code review

54 tests

User reviews

1 review

Install metrics

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

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

Analyzing server-side resources used by Push Notifications by Shops2Apps
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.89 ▼1.04
Dashboard /wp-admin3.32 ▲0.0246.12 ▼4.22
Posts /wp-admin/edit.php3.37 ▲0.0145.48 ▲0.58
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.60 ▼9.35
Media Library /wp-admin/upload.php3.24 ▲0.0132.40 ▼3.77
Push Notification Scheduler /wp-admin/admin.php?page=shops2apps-pn-scheduler3.2530.95

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Push Notifications by Shops2Apps
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7413.20 ▼1.181.82 ▼0.3344.37 ▼0.13
Dashboard /wp-admin2,237 ▲524.85 ▼1.05109.78 ▼6.2343.13 ▼0.46
Posts /wp-admin/edit.php2,117 ▲282.06 ▼0.0736.14 ▲1.1732.11 ▼2.92
Add New Post /wp-admin/post-new.php1,561 ▲2823.27 ▲0.11649.56 ▼19.2650.02 ▼4.95
Media Library /wp-admin/upload.php1,422 ▲374.29 ▲0.0695.31 ▼10.4943.74 ▼3.35
/wp-admin/admin.php?page=#shops2apps280.440.063.69
Push Notification Scheduler /wp-admin/admin.php?page=shops2apps-pn-scheduler9021.9131.5534.57

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=shops2apps-pn-scheduler
    • > Notice in wp-content/plugins/push-notifications-by-shops2apps/inc/api-registration-form.php+123
    Undefined index: s

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/push-notifications-by-shops2apps/inc/api-registration-form.php:93

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/admin.php?page=#shops2apps
    • > Network (severe)
    wp-admin/admin.php?page=#shops2apps - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate 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

push-notifications-by-shops2apps/push-notification.php 85% from 13 tests

The main PHP script in "Push Notifications by Shops2Apps" version 0.1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("push-notifications-by-shops2apps.php" instead of "push-notification.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 172 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected1,988 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1013665943
SVG100655
CSS34071387
JavaScript1032
JSON1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
14 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%