10% gna-slack-notification

Code Review | GNA Slack Notification

WordPress plugin GNA Slack Notification scored10%from 54 tests.

About plugin

  • Plugin page: gna-slack-notific...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 6.3.1
  • First release: Apr 3, 2016
  • Latest release: Sep 5, 2016
  • Number of updates: 23
  • Update frequency: every 11.2 days
  • Top authors: chris_dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /770 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_Slack::activate_handler() should not be called statically

Server metrics [RAM: ▼0.66MB] [CPU: ▼15.74ms] Passed 4 tests

Server-side resources used by GNA Slack Notification
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.76 ▲1.35
Dashboard /wp-admin3.33 ▲0.0348.49 ▼6.23
Posts /wp-admin/edit.php3.44 ▲0.0947.79 ▼1.97
Add New Post /wp-admin/post-new.php3.18 ▼2.7141.75 ▼56.11
Media Library /wp-admin/upload.php3.25 ▲0.0239.07 ▲1.75

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for GNA Slack Notification
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲8013.64 ▼1.121.81 ▼0.2947.31 ▼0.86
Dashboard /wp-admin2,206 ▲185.82 ▼0.07107.47 ▲5.9582.57 ▲38.54
Posts /wp-admin/edit.php2,107 ▲181.98 ▼0.0234.58 ▼4.0832.26 ▼0.20
Add New Post /wp-admin/post-new.php1,681 ▲13922.62 ▲4.41750.40 ▲115.3258.31 ▼0.16
Media Library /wp-admin/upload.php1,397 ▲64.20 ▲0.00101.26 ▲2.1670.93 ▲28.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_Slack::deactivate_handler() should not be called statically
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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
Good news, no errors were detected

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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gna-slack-notification/inc/gna-slack-notification-config.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GNA_Slack_Admin_Menu' not found in wp-content/plugins/gna-slack-notification/admin/gna-slack-notification-admin-settings-menu.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: "none"
The official readme.txt is a good inspiration

gna-slack-notification/gna-slack-notification.php Passed 13 tests

The principal PHP file in "GNA Slack Notification" v. 1.0.0 is loaded by WordPress automatically on each request
75 characters long description:
Send notifications to Slack channels when certain events occur in WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin778 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP710265667
JavaScript14165
CSS14046

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity10.50
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods53
▷ Static methods713.21%
▷ Public methods53100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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
assets/images/gna_20x20.png2.98KB0.33KB▼ 88.89%