77% post-category-fcm-notifications

Code Review | WordPress Post FCM

WordPress plugin WordPress Post FCM scored77%from 54 tests.

About plugin

  • Plugin page: post-category-fcm...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.4
  • WordPress version: 6.3.1
  • First release: Aug 12, 2020
  • Latest release: Aug 12, 2020
  • Number of updates: 8
  • Update frequency: every 5.3 days
  • Top authors: emil90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /567 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
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼2.63ms] Passed 4 tests

Server-side resources used by WordPress Post FCM
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.17 ▼8.15
Dashboard /wp-admin3.34 ▲0.0452.62 ▼2.04
Posts /wp-admin/edit.php3.46 ▲0.1154.87 ▲6.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0489.48 ▼7.02
Media Library /wp-admin/upload.php3.26 ▲0.0342.09 ▲7.79
Post FCM settings /wp-admin/admin.php?page=post_fcm_settings3.2936.49
Post FCM Notifications /wp-admin/admin.php?page=admin_menu_pfcm3.2939.43

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Post FCM
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲22114.65 ▲0.461.83 ▼0.0938.38 ▼5.62
Dashboard /wp-admin2,358 ▲1676.43 ▲0.55121.45 ▲4.7389.99 ▲44.57
Posts /wp-admin/edit.php2,282 ▲1933.37 ▲1.3552.64 ▲17.6278.49 ▲38.93
Add New Post /wp-admin/post-new.php1,693 ▲15122.32 ▲4.30693.57 ▲35.6836.69 ▼17.27
Media Library /wp-admin/upload.php1,421 ▲394.11 ▼0.0677.67 ▼31.8792.65 ▲50.45
Post FCM settings /wp-admin/admin.php?page=post_fcm_settings1,1403.0240.1562.38
Post FCM Notifications /wp-admin/admin.php?page=admin_menu_pfcm1,0693.0237.6663.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=post_fcm_settings
    • > Notice in wp-content/plugins/post-category-fcm-notifications/admin/partials/postcategory-fcm-notifications-admin-settings.php+104
    Undefined variable: pfcm_icon

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/post-category-fcm-notifications/admin/partials/postcategory-fcm-notifications-admin-display.php:91
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/post-category-fcm-notifications/admin/partials/postcategory-fcm-notifications-admin-settings.php:21

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 Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: notifications, emil90, fcm, firebase

post-category-fcm-notifications/postcategory-fcm-notifications.php 69% from 13 tests

"WordPress Post FCM" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0" instead of "5.2")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("post-category-fcm-notifications.php" instead of "postcategory-fcm-notifications.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "5.2")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected617 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP13148514446
CSS104119
JavaScript1163452

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity3.50
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods27
▷ Static methods27.41%
▷ Public methods2385.19%
▷ Protected methods00.00%
▷ Private methods414.81%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/fcm-icon.png0.66KB0.54KB▼ 17.71%