68% f70-lead-document-download

Code Review | F70 Lead Document Download

WordPress plugin F70 Lead Document Download scored68%from 54 tests.

About plugin

  • Plugin page: f70-lead-document...
  • Plugin version: 1.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.3
  • WordPress version: 6.3.1
  • First release: Feb 12, 2021
  • Latest release: Oct 10, 2023
  • Number of updates: 12
  • Update frequency: every 80.9 days
  • Top authors: niao70 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,339 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼6.07ms] Passed 4 tests

This is a short check of server-side resources used by F70 Lead Document Download
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1638.40 ▼2.49
Dashboard /wp-admin3.66 ▲0.3148.56 ▼11.91
Posts /wp-admin/edit.php3.71 ▲0.3550.93 ▲2.32
Add New Post /wp-admin/post-new.php6.16 ▲0.2784.14 ▼11.15
Media Library /wp-admin/upload.php3.50 ▲0.2736.56 ▲1.29
Form /wp-admin/edit.php?post_type=f70_lead_document3.6339.27
Settings /wp-admin/admin.php?page=f70ldd-setting-admin3.5036.77

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 56 new files
Database: 1 new table, 12 new options
New tables
wp_f70ldd_entry_list
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
f70ldd_db_version
f70ldd_download_page_id
f70ldd_cookie_delete_key
widget_recent-comments
f70ldd_download_number_limit
f70ldd_email_body_to_admin
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for F70 Lead Document Download
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲20714.25 ▼0.391.65 ▲0.0940.42 ▼0.26
Dashboard /wp-admin2,369 ▲1926.19 ▲0.66107.45 ▲19.9537.62 ▼3.22
Posts /wp-admin/edit.php2,300 ▲2003.44 ▲1.4943.79 ▲4.1231.59 ▲0.88
Add New Post /wp-admin/post-new.php1,558 ▲3223.32 ▲0.31643.35 ▼32.1235.54 ▼20.82
Media Library /wp-admin/upload.php1,431 ▲314.12 ▼0.1278.20 ▼21.1540.83 ▼4.15
Form /wp-admin/edit.php?post_type=f70_lead_document1,2733.2544.5226.75
Settings /wp-admin/admin.php?page=f70ldd-setting-admin1,2643.0336.7168.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_f70ldd_entry_list
  • This plugin does not fully uninstall, leaving 12 options in the database
    • f70ldd_db_version
    • widget_theysaidso_widget
    • can_compress_scripts
    • f70ldd_email_body_to_admin
    • widget_recent-posts
    • f70ldd_email_body_to_user
    • db_upgraded
    • f70ldd_download_page_id
    • widget_recent-comments
    • theysaidso_admin_options
    • ...

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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/f70-lead-document-download/views/download_ng.php
    • > /wp-content/plugins/f70-lead-document-download/views/download.php
    • > /wp-content/plugins/f70-lead-document-download/trunk/views/download_ng.php
    • > /wp-content/plugins/f70-lead-document-download/trunk/views/download.php
  • 20× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/trunk/views/entry_ng.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/views/email_to_user.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/trunk/views/email_to_user.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/trunk/views/email_to_admin.php:1
    • > PHP Warning
      Use of undefined constant F70_LDD__COOKIE_NAME - assumed 'F70_LDD__COOKIE_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/f70-lead-document-download/trunk/views/entry_ng.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/views/accepted.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'f70LddFunctions' not found in wp-content/plugins/f70-lead-document-download/trunk/views/entry.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/trunk/views/accepted.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/f70-lead-document-download/views/email_to_admin.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: download, form, email, marketing, subscribe

f70-lead-document-download/f70-lead-document-download.php 92% from 13 tests

Analyzing the main PHP file in "F70 Lead Document Download" version 1.1
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 184 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin2,249 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP174282161,677
Sass65311277
CSS2912230
JavaScript1211765

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity22.33
▷ Minimum class complexity4.00
▷ Maximum class complexity81.00
Average method complexity3.46
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods156
▷ Static methods7044.87%
▷ Public methods156100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants24100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.63MB with 0.42MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/image/istk-portfolio.png324.83KB110.58KB▼ 65.96%
trunk/assets/image/istk-portfolio.png324.83KB110.58KB▼ 65.96%