84% tw-header-footer-codes

Code Review | TW Header & Footer Codes

WordPress plugin TW Header & Footer Codes scored84%from 54 tests.

About plugin

  • Plugin page: tw-header-footer-...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.1.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2019
  • Latest release: Mar 18, 2019
  • Number of updates: 8
  • Update frequency: every 1.4 days
  • Top authors: themewarrior (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /751 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.73ms] Passed 4 tests

Analyzing server-side resources used by TW Header & Footer Codes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.48 ▼6.89
Dashboard /wp-admin3.37 ▲0.0645.66 ▼3.25
Posts /wp-admin/edit.php3.42 ▲0.0655.18 ▲6.19
Add New Post /wp-admin/post-new.php5.95 ▲0.0691.86 ▼7.62
Media Library /wp-admin/upload.php3.29 ▲0.0633.59 ▼1.15
TW Header & Footer Codes /wp-admin/options-general.php?page=twhfc3.2529.16

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
twhfc_options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for TW Header & Footer Codes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.44 ▲0.191.73 ▼0.0839.12 ▼5.12
Dashboard /wp-admin2,210 ▲226.04 ▲0.99113.01 ▲12.1142.97 ▼0.24
Posts /wp-admin/edit.php2,093 ▲42.14 ▲0.0838.96 ▼5.7636.78 ▲2.51
Add New Post /wp-admin/post-new.php1,545 ▲318.29 ▼0.18613.76 ▲19.7552.19 ▼0.64
Media Library /wp-admin/upload.php1,395 ▲134.17 ▼0.06100.15 ▲3.6742.07 ▼3.64
TW Header & Footer Codes /wp-admin/options-general.php?page=twhfc9092.0523.9728.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • twhfc_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tw-header-footer-codes/includes/functions.php:22

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 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

tw-header-footer-codes/tw-header-footer-codes.php Passed 13 tests

Analyzing the main PHP file in "TW Header & Footer Codes" version 1.0.4
67 characters long description:
Add custom header and footer codes anywhere in your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected339 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP45891235
PO File1232380
CSS13024

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.41
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo-themewarrior.png8.40KB3.84KB▼ 54.30%