73% push-notification-for-post-and-buddypress

Code Review | Push Notification for Post and BuddyPress

WordPress plugin Push Notification for Post and BuddyPress scored73%from 54 tests.

About plugin

  • Plugin page: push-notification...
  • Plugin version: 1.77
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 14, 2020
  • Latest release: Dec 2, 2023
  • Number of updates: 308
  • Update frequency: every 4.6 days
  • Top authors: murali-indiacitys (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

200+ active /11,962 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲3.38MB] [CPU: ▲36.58ms] Passed 4 tests

A check of server-side resources used by Push Notification for Post and BuddyPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.83 ▲3.3773.61 ▲31.93
Dashboard /wp-admin6.69 ▲3.3982.39 ▲32.56
Posts /wp-admin/edit.php6.74 ▲3.3987.98 ▲40.51
Add New Post /wp-admin/post-new.php9.27 ▲3.39130.79 ▲41.31
Media Library /wp-admin/upload.php6.61 ▲3.3876.21 ▲43.70
One time push notifications list /wp-admin/admin.php?page=pnfpb_icfm_onetime_notifications_list6.5971.89
Action scheduler /wp-admin/admin.php?page=pnfpb_icfm_action_scheduler6.7776.27
NGNIX /wp-admin/admin.php?page=pnfpb_icfm_settings_for_ngnix_server6.5869.20
Customize Buttons /wp-admin/admin.php?page=pnfpb_icfm_button_settings6.7475.98
Frontend subscription /wp-admin/admin.php?page=pnfpb_icfm_frontend_settings6.5669.29
Integrate Mobile App /wp-admin/admin.php?page=pnfpb_icfm_integrate_app6.5063.25
Scheduled Actions /wp-admin/tools.php?page=action-scheduler6.7974.58
On demand/One time Notification /wp-admin/admin.php?page=pnfpb_icfmtest_notification6.9371.14
PWA app /wp-admin/admin.php?page=pnfpb_icfm_pwa_app_settings6.7473.44
Push settings /wp-admin/admin.php?page=pnfpb-icfcm-slug7.1198.68

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 925 new files
Database: 6 new tables, 10 new options
New tables
wp_actionscheduler_logs
wp_actionscheduler_claims
wp_actionscheduler_actions
wp_pnfpb_ic_schedule_push_notifications
wp_pnfpb_ic_subscribed_deviceids_web
wp_actionscheduler_groups
New WordPress options
widget_recent-posts
db_upgraded
schema-ActionScheduler_LoggerSchema
schema-ActionScheduler_StoreSchema
widget_recent-comments
widget_theysaidso_widget
action_scheduler_hybrid_store_demarkation
theysaidso_admin_options
can_compress_scripts
action_scheduler_lock_async-request-runner

Browser metrics Passed 4 tests

Checking browser requirements for Push Notification for Post and BuddyPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,078 ▲31613.96 ▼0.369.15 ▲7.3538.06 ▼5.89
Dashboard /wp-admin2,313 ▲1435.89 ▲0.2099.64 ▼3.7144.12 ▼3.16
Posts /wp-admin/edit.php2,220 ▲1202.39 ▲0.3740.90 ▲3.8338.28 ▲2.68
Add New Post /wp-admin/post-new.php6,292 ▲4,76619.65 ▼3.99885.70 ▲278.5048.99 ▼11.86
Media Library /wp-admin/upload.php1,521 ▲1184.51 ▲0.3597.79 ▼0.5643.91 ▲0.12
One time push notifications list /wp-admin/admin.php?page=pnfpb_icfm_onetime_notifications_list1,4002.1835.9036.78
Action scheduler /wp-admin/admin.php?page=pnfpb_icfm_action_scheduler1,3492.1935.8635.71
NGNIX /wp-admin/admin.php?page=pnfpb_icfm_settings_for_ngnix_server1,0122.0131.4729.91
Customize Buttons /wp-admin/admin.php?page=pnfpb_icfm_button_settings1,6603.5544.0237.03
Frontend subscription /wp-admin/admin.php?page=pnfpb_icfm_frontend_settings1,1762.0529.3334.61
Integrate Mobile App /wp-admin/admin.php?page=pnfpb_icfm_integrate_app1,0382.0231.9231.44
Scheduled Actions /wp-admin/tools.php?page=action-scheduler1,3682.1931.1729.69
On demand/One time Notification /wp-admin/admin.php?page=pnfpb_icfmtest_notification1,6663.4349.8734.76
PWA app /wp-admin/admin.php?page=pnfpb_icfm_pwa_app_settings1,8223.3143.1336.79
Push settings /wp-admin/admin.php?page=pnfpb-icfcm-slug3,1653.3946.3696.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure failed, leaving 5 tables in the database
    • wp_actionscheduler_actions
    • wp_pnfpb_ic_schedule_push_notifications
    • wp_actionscheduler_groups
    • wp_actionscheduler_claims
    • wp_actionscheduler_logs
  • Zombie WordPress options detected upon uninstall: 11 options
    • db_upgraded
    • action_scheduler_hybrid_store_demarkation
    • schema-ActionScheduler_LoggerSchema
    • can_compress_scripts
    • schema-ActionScheduler_StoreSchema
    • widget_theysaidso_widget
    • action_scheduler_migration_status
    • widget_recent-posts
    • widget_recent-comments
    • action_scheduler_lock_async-request-runner
    • ...

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 428× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\EC\\BaseCurves\\Binary' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/sect571r1.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\Common\\FiniteField\\Integer' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'ParagonIE\\ConstantTime\\EncoderInterface' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/paragonie/constant_time_encoding/src/Hex.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/push-notification-for-post-and-buddypress/libraries/action-scheduler/classes/WP_CLI/Migration_Command.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE\\ConstantTime\\Base64' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\PHP' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Google\\Model' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/google/apiclient-services/src/FirebaseCloudMessaging/AndroidFcmOptions.php:20
    • > PHP Warning
      Class 'Google\\Service' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/google/apiclient/src/aliases.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/push-notification-for-post-and-buddypress/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 86% 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 need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can take inspiration from this readme.txt

push-notification-for-post-and-buddypress/pnfpb_push_notification.php 77% from 13 tests

This is the main PHP file of "Push Notification for Post and BuddyPress" version 1.77, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("push-notification-for-post-and-buddypress.php" instead of "pnfpb_push_notification.php")
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Description: Please don't use more than 140 characters for the plugin description (currently 203 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected95,976 lines of code in 868 files:
LanguageFilesBlank linesComment linesLines of code
PHP77616,81545,22075,935
JavaScript272,8686738,741
Markdown362,15105,950
CSS6531633,070
JSON219802,258
XML10019
Bourne Shell1203

PHP code 0% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,410)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity14.54
▷ Minimum class complexity1.00
▷ Maximum class complexity1,410.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces80
Interfaces53
Traits15
Classes693
▷ Abstract classes23233.48%
▷ Concrete classes46166.52%
▷ Final classes6614.32%
Methods4,177
▷ Static methods78018.67%
▷ Public methods3,12274.74%
▷ Protected methods53312.76%
▷ Private methods52212.50%
Functions201
▷ Named functions3617.91%
▷ Anonymous functions16582.09%
Constants577
▷ Global constants417.11%
▷ Class constants53692.89%
▷ Public constants48991.23%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/icon_push_subscribe.png0.40KB0.75KB0.00%
public/img/pnfpb_push_icon.png2.19KB1.49KB▼ 31.91%
public/img/pushbell-pnfpb.png6.39KB2.50KB▼ 60.85%
public/img/icon.png67.93KB20.67KB▼ 69.57%
public/img/icon_132.png14.44KB4.97KB▼ 65.55%