84% headlineenvy

Code Review | HeadlineEnvy - headline testing with Optimizely

WordPress plugin HeadlineEnvy - headline testing with Optimizely scored84%from 54 tests.

About plugin

  • Plugin page: headlineenvy
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.2
  • WordPress version: 6.3.1
  • First release: Apr 3, 2015
  • Latest release: Sep 1, 2015
  • Number of updates: 19
  • Update frequency: every 8.0 days
  • Top authors: methnen (78.95%)borkweb (21.05%)zbtirrell (10.53%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,857 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.20MB] [CPU: ▼4.71ms] Passed 4 tests

An overview of server-side resources used by HeadlineEnvy - headline testing with Optimizely
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1241.60 ▼2.34
Dashboard /wp-admin3.57 ▲0.2755.32 ▲3.12
Posts /wp-admin/edit.php3.63 ▲0.2747.96 ▼3.76
Add New Post /wp-admin/post-new.php6.09 ▲0.2186.24 ▼15.86
Media Library /wp-admin/upload.php3.44 ▲0.2136.58 ▲3.19
Results /wp-admin/admin.php?page=headline-envy-results3.4435.66
HeadlineEnvy /wp-admin/admin.php?page=headline-envy-settings3.4437.59

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for HeadlineEnvy - headline testing with Optimizely
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15013.46 ▼0.7511.15 ▲9.5245.04 ▲6.83
Dashboard /wp-admin2,231 ▲545.49 ▼0.1784.73 ▼6.8843.71 ▼1.50
Posts /wp-admin/edit.php2,140 ▲401.97 ▼0.0537.11 ▼1.3436.43 ▼3.79
Add New Post /wp-admin/post-new.php1,564 ▲3823.25 ▲0.02650.08 ▲42.8955.24 ▲5.59
Media Library /wp-admin/upload.php1,442 ▲424.22 ▲0.06100.51 ▼7.4847.97 ▼3.62
Results /wp-admin/admin.php?page=headline-envy-results8222.0627.4925.80
HeadlineEnvy /wp-admin/admin.php?page=headline-envy-settings8832.0625.7931.76

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

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 | 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
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/headlineenvy/components/templates/title-ui.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/headlineenvy/components/class-headline-envy.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/headlineenvy/components/templates/results.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/headlineenvy/components/templates/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/headlineenvy/components/templates/credits.php:7

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: headline, ab testing, post, page, testing...

headlineenvy/headlineenvy.php Passed 13 tests

Analyzing the main PHP file in "HeadlineEnvy - headline testing with Optimizely" version 1.0.2
48 characters long description:
Leverages Optimizely to A/B test post headlines.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,760 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP93063791,371
CSS230217
JavaScript64514143
Markdown14016
XML10013

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity48.00
▷ Minimum class complexity6.00
▷ Maximum class complexity102.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods78
▷ Static methods00.00%
▷ Public methods7393.59%
▷ Protected methods33.85%
▷ Private methods22.56%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
components/img/funnelenvy-logo.png1.90KB2.43KB0.00%