84% funnel

Code Review | Funnel

WordPress plugin Funnel scored 84% from 54 tests.

About plugin

  • Plugin page: funnel
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Jul 28, 2020
  • Latest release: Jul 5, 2023
  • Number of updates: 18
  • Update frequency: every 59.6 days
  • Top authors: eggemplo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 2,156 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼25.55ms] Passed 4 tests

A check of server-side resources used by Funnel
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0647.67 ▼28.51
Dashboard /wp-admin3.36 ▲0.0558.27 ▼4.45
Posts /wp-admin/edit.php3.41 ▲0.0572.76 ▲18.76
Add New Post /wp-admin/post-new.php6.00 ▲0.11111.37 ▼70.80
Media Library /wp-admin/upload.php3.28 ▲0.0541.80 ▲1.55
Leads /wp-admin/edit.php?post_type=funnel_lead3.3234.83
Add new /wp-admin/post-new.php?post_type=funnel_lead3.4264.99
States /wp-admin/edit-tags.php?taxonomy=funnel_state&post_type=funnel_lead3.3659.41
Settings /wp-admin/edit.php?post_type=funnel_lead&page=funnel_settings3.2635.04

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
funnel_state_children

Browser metrics Passed 4 tests

An overview of browser requirements for Funnel
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,865 ▲13313.02 ▼1.0412.20 ▲10.4965.95 ▼18.73
Dashboard /wp-admin2,233 ▲515.79 ▲0.83136.82 ▼43.1667.68 ▲9.42
Posts /wp-admin/edit.php2,127 ▲382.12 ▼0.0451.30 ▼9.0840.11 ▼22.63
Add New Post /wp-admin/post-new.php1,440 ▼7918.18 ▼5.15660.69 ▼131.2583.48 ▲0.12
Media Library /wp-admin/upload.php1,420 ▲384.41 ▲0.26139.67 ▲23.4761.03 ▼16.65
Leads /wp-admin/edit.php?post_type=funnel_lead1,1082.0270.2244.05
Add new /wp-admin/post-new.php?post_type=funnel_lead1,7283.6476.7647.11
States /wp-admin/edit-tags.php?taxonomy=funnel_state&post_type=funnel_lead1,5912.1433.6980.74
Settings /wp-admin/edit.php?post_type=funnel_lead&page=funnel_settings8842.0323.8228.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • funnel_state_children
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/funnel/funnel.php on line 32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/funnel/funnel.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/funnel/core/class-funnel-tax.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/funnel/core/class-funnel-cpt.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/funnel/core/class-funnel-profile.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/funnel/core/class-funnel-wp.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/funnel/core/class-funnel-metabox.php:8

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 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 to be fixed:
  • Screenshots: These screenshots require images: #1 (States example list.), #2 (Lead detail.), #3 (Funnel settings in Pages), #4 (Settings. Users tab.), #5 (Settings. Pages tab.), #6 (Settings. Referrer tab.)
The official readme.txt is a good inspiration

funnel/funnel.php Passed 13 tests

The main file in "Funnel" v. 1.3.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
34 characters long description:
Organize your users into a funnel.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected780 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP7104112670
PO File1248458101
CSS1009

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods33100.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.20MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png29.41KB8.25KB▼ 71.96%
screenshot-4.png18.48KB4.82KB▼ 73.91%
screenshot-2.png8.48KB2.46KB▼ 71.01%
screenshot-3.png22.08KB7.00KB▼ 68.29%
screenshot-5.png20.11KB5.71KB▼ 71.61%