78% push-notification-fcm

Code Review | Push Notification FCM

WordPress plugin Push Notification FCM scored78%from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 1.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 29, 2022
  • Latest release: Aug 9, 2023
  • Number of updates: 20
  • Update frequency: every 18.8 days
  • Top authors: ivijanstefan (85%)creativform (20%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,775 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.16ms] 75% from 4 tests

This is a short check of server-side resources used by Push Notification FCM
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 2,242.25ms on /wp-admin/admin.php?page=push-notification-fcm-settings)
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0743.90 ▼2.63
Dashboard /wp-admin3.39 ▲0.0849.28 ▼2.43
Posts /wp-admin/edit.php3.50 ▲0.1447.76 ▼7.75
Add New Post /wp-admin/post-new.php5.98 ▲0.0988.72 ▼19.82
Media Library /wp-admin/upload.php3.31 ▲0.0835.85 ▲1.97
Devices /wp-admin/admin.php?page=push-notification-fcm3.3136.79
Settings /wp-admin/admin.php?page=push-notification-fcm-settings3.622,242.25

Server storage [IO: ▲0.36MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Push Notification FCM: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.22 ▼1.341.67 ▼0.2245.76 ▼0.49
Dashboard /wp-admin2,233 ▲424.89 ▲0.02117.60 ▼20.2543.36 ▲0.16
Posts /wp-admin/edit.php2,116 ▲271.97 ▼0.0434.78 ▼1.0933.21 ▼1.51
Add New Post /wp-admin/post-new.php1,555 ▲2223.37 ▲0.14683.35 ▲17.1873.03 ▲20.32
Media Library /wp-admin/upload.php1,418 ▲274.16 ▼0.0399.31 ▼8.9540.35 ▼4.25
Devices /wp-admin/admin.php?page=push-notification-fcm1,0622.0426.2628.46
Settings /wp-admin/admin.php?page=push-notification-fcm-settings1,2342.1333.0348.53

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 75% 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 uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/push-notification-fcm/includes/API.php
    • > /wp-content/plugins/push-notification-fcm/includes/REST.php
    • > /wp-content/plugins/push-notification-fcm/includes/Metabox.php
    • > /wp-content/plugins/push-notification-fcm/includes/Settings.php
    • > /wp-content/plugins/push-notification-fcm/includes/Devices.php
    • > /wp-content/plugins/push-notification-fcm/push-notification-fcm.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/push-notification-fcm/admin/Devices.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/push-notification-fcm/admin/Settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
8 plugin tags: fcm, integration, push notifications, device registration, ios...

push-notification-fcm/push-notification-fcm.php 92% from 13 tests

Analyzing the main PHP file in "Push Notification FCM" version 1.0.6
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected2,131 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP92923191,776
PO File1103114271
CSS18053
JavaScript15031

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity32.00
▷ Minimum class complexity11.00
▷ Maximum class complexity73.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods63
▷ Static methods1219.05%
▷ Public methods5688.89%
▷ Protected methods00.00%
▷ Private methods711.11%
Functions8
▷ Named functions00.00%
▷ Anonymous functions8100.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
12 PNG files occupy 0.23MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/16x16/WOS.png18.88KB0.59KB▼ 96.85%
assets/16x16/ATV.png19.78KB0.37KB▼ 98.11%
assets/16x16/AND.png19.60KB0.56KB▼ 97.15%
assets/16x16/WIN.png20.04KB0.43KB▼ 97.87%
assets/16x16/XBX.png18.89KB0.62KB▼ 96.72%