10% tf-notifications

Code Review | TF Notifications

WordPress plugin TF Notifications scored 10% from 54 tests.

About plugin

  • Plugin page: tf-notifications
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2015
  • Latest release: Mar 31, 2023
  • Number of updates: 26
  • Update frequency: every 122.1 days
  • Top authors: timfitt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 550 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Error in wp-content/plugins/tf-notifications/tf-notifications.php+46
    Uncaught Error: Call to undefined method TFWPN_TF_Notifications_Activator::activate() in wp-content/plugins/tf-notifications/tf-notifications.php:46
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): activate_tfwpn_tf_notifications()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼0.90ms] Passed 4 tests

A check of server-side resources used by TF Notifications
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.26 ▲1.51
Dashboard /wp-admin3.31 ▲0.0045.51 ▼4.20
Posts /wp-admin/edit.php3.36 ▲0.0048.80 ▲0.13
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.77 ▼1.05
Media Library /wp-admin/upload.php3.23 ▲0.0036.97 ▲4.05

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 62 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TF Notifications
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.18 ▼1.281.68 ▼0.6638.93 ▼13.06
Dashboard /wp-admin2,206 ▲185.85 ▲0.80107.86 ▲7.2640.83 ▼5.52
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0339.57 ▼3.3934.16 ▼2.88
Add New Post /wp-admin/post-new.php1,514 ▼1917.39 ▼5.47666.47 ▲7.2754.72 ▲1.56
Media Library /wp-admin/upload.php1,388 ▲34.17 ▼0.0592.49 ▼12.0440.82 ▼3.79

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 does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tf-notifications/public/partials/tfwpn-tf-notifications-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/tf-notifications/admin/partials/tfwpn-tf-notifications-admin-display.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: notifications

tf-notifications/tf-notifications.php 92% from 13 tests

The principal PHP file in "TF Notifications" v. 1.1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected4,055 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript54788873,302
PHP13180645556
CSS54348197

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.38
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3286.49%
▷ Protected methods00.00%
▷ Private methods513.51%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
30 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/images/controls.png2.83KB1.28KB▼ 54.82%
public/css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
public/css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
public/css/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%