62% subject-line-scorer

Code Review | Subject Line Scorer

WordPress plugin Subject Line Scorer scored62%from 54 tests.

About plugin

  • Plugin page: subject-line-scorer
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2.1
  • WordPress version: 6.3.1
  • First release: Jun 13, 2019
  • Latest release: Jul 4, 2019
  • Number of updates: 3
  • Update frequency: every 9.3 days
  • Top authors: gkoncz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /813 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.23MB] [CPU: ▼45.82ms] Passed 4 tests

This is a short check of server-side resources used by Subject Line Scorer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.74 ▼0.7211.59 ▼24.95
Dashboard /wp-admin2.78 ▼0.5213.07 ▼35.51
Posts /wp-admin/edit.php2.78 ▼0.5717.55 ▼31.28
Add New Post /wp-admin/post-new.php2.78 ▼3.1115.23 ▼91.54
Media Library /wp-admin/upload.php2.78 ▼0.4513.21 ▼20.21
Subject Line Scorer /wp-admin/options-general.php?page=wta_settings2.7815.90

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 113 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Subject Line Scorer
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲24214.10 ▼0.077.11 ▲5.4840.05 ▼0.87
Dashboard /wp-admin2,261 ▲735.25 ▲0.36101.91 ▼11.4946.43 ▲4.32
Posts /wp-admin/edit.php2,140 ▲482.54 ▲0.5439.90 ▼0.3934.20 ▼0.91
Add New Post /wp-admin/post-new.php1,553 ▲1123.05 ▲4.40658.27 ▲12.4156.95 ▲6.29
Media Library /wp-admin/upload.php1,439 ▲484.60 ▲0.37106.52 ▲9.2145.12 ▲0.25
Subject Line Scorer /wp-admin/options-general.php?page=wta_settings9031.9429.2929.32

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+260
    Undefined variable: locale_taro
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+261
    Undefined variable: locale_taro
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+13
    Undefined index: save_settings_field
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/scripts.php+52
    Undefined index: localization
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+150
    Undefined index: class
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+150
    Undefined index: id
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+150
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+152
    Undefined index: sub_text
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Notice in wp-content/plugins/subject-line-scorer/modules/settings.php+152
    Undefined variable: out

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
Almost there! Just fix the following items
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/subject-line-scorer/modules/ajax.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/subject-line-scorer/modules/meta_box.php:227
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/subject-line-scorer/modules/shortcodes.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/subject-line-scorer/modules/cpt.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/subject-line-scorer/modules/hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_Action() in wp-content/plugins/subject-line-scorer/modules/settings.php:253
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/subject-line-scorer/modules/scripts.php:64
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/subject-line-scorer/modules/scripts.php:64

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/subject-line-scorer/modules/js/admin.js?ver=6.3.1:382:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=wta_settings
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please a description for screenshot #2 in subject-line-scorer/assets to your readme.txt
  • Contributors: Plugin contributors field is missing
You can take inspiration from this readme.txt

subject-line-scorer/subject-line-scorer.php 92% from 13 tests

The main file in "Subject Line Scorer" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 150 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected39,320 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
CSS171,45825518,723
JavaScript203,6632,41911,735
SVG6032,858
Sass1434341,768
LESS1434441,758
HTML1617911,366
PHP9301481,112

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity12.50
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity4.63
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants0
▷ Global constants00.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
5 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/inc/assets/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%
modules/inc/assets/css/glyphicons-halflings-white.png8.57KB9.20KB0.00%
modules/inc/assets/css/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
modules/images/icon_16.png1.28KB0.88KB▼ 30.81%
modules/inc/assets/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%