79% leader

Code Review | Leader

WordPress plugin Leader scored 79% from 54 tests.

About plugin

  • Plugin page: leader
  • Plugin version: 2.6.1
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-5.6
  • WordPress version: 6.3.1
  • First release: Sep 23, 2018
  • Latest release: Dec 15, 2020
  • Number of updates: 90
  • Update frequency: every 9.1 days
  • Top authors: leadercodes (98.89%)ramsegev (2.22%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 3,589 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.57MB] [CPU: ▲12.75ms] Passed 4 tests

Analyzing server-side resources used by Leader
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6151.76 ▲8.55
Dashboard /wp-admin3.90 ▲0.6064.96 ▲14.49
Posts /wp-admin/edit.php3.95 ▲0.6064.54 ▲15.76
Add New Post /wp-admin/post-new.php6.46 ▲0.57110.35 ▲13.10
Media Library /wp-admin/upload.php3.76 ▲0.5350.96 ▲14.87
Welcome Mail /wp-admin/edit.php?post_type=leader&page=leader_welcoming3.8051.45
Leader Box /wp-admin/edit.php?post_type=leader3.8753.63
Social Signature /wp-admin/edit.php?post_type=leader&page=leader_engaging3.8551.54
Add New Leader /wp-admin/post-new.php?post_type=leader3.9869.10

Server storage [IO: ▲6.30MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 317 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
lr_fields
db_upgraded

Browser metrics Passed 4 tests

Leader: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,017 ▲28213.88 ▼0.498.33 ▲6.3838.82 ▼12.50
Dashboard /wp-admin2,251 ▲604.86 ▼0.0397.45 ▼7.3770.99 ▲29.32
Posts /wp-admin/edit.php2,146 ▲572.02 ▲0.0139.98 ▲4.8135.12 ▲2.96
Add New Post /wp-admin/post-new.php1,583 ▲5018.40 ▼4.76669.45 ▲0.4665.38 ▲8.83
Media Library /wp-admin/upload.php1,448 ▲574.22 ▲0.0498.77 ▼0.1668.87 ▲26.53
Welcome Mail /wp-admin/edit.php?post_type=leader&page=leader_welcoming2,3815.87129.24166.65
Leader Box /wp-admin/edit.php?post_type=leader1,7521.9434.4057.92
Social Signature /wp-admin/edit.php?post_type=leader&page=leader_engaging2,6546.16113.31130.45
Add New Leader /wp-admin/post-new.php?post_type=leader3,5766.49142.0299.94

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/leader/admin/partials/leader-social-bar.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/leader/admin/partials/leader-form.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/leader/admin/partials/leader-video-popup.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/leader/admin/partials/leader-hello-bar.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_current_screen() in wp-content/plugins/leader/admin/partials/leader-engaging.php:43
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/leader/admin/partials/leader-welcoming.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=leader
    • > Javascript (severe) in unknown
    /wp-content/plugins/leader/admin/js/leader-admin.js?ver=2.6.1 474:16 Uncaught TypeError: $ is not a function
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=leader
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at get_waves (/wp-content/plugins/leader/admin/js/leader-admin.js?ver=2.6.1:475:17)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/leader/admin/js/leader-admin.js?ver=2.6.1:88:3)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=leader
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: lead capture, contact form, marketing automation, hello bar, crm

leader/leader.php Passed 13 tests

The main file in "Leader" v. 2.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
45 characters long description:
Leader - lead capture tool that work for you.

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
Success! There were no dangerous files found in this plugin81,630 lines of code in 283 files:
LanguageFilesBlank linesComment linesLines of code
CSS155,41960235,646
JavaScript284,1374,46821,699
Sass2223,8132,77720,481
PHP172397753,214
PO File1213233590

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity42.50
▷ Minimum class complexity1.00
▷ Maximum class complexity209.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods78
▷ Static methods22.56%
▷ Public methods6684.62%
▷ Protected methods00.00%
▷ Private methods1215.38%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
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
22 PNG files occupy 0.29MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/leader-snapchat.png2.35KB1.62KB▼ 31.14%
admin/images/leader-avater15X15.png1.06KB0.86KB▼ 18.22%
admin/images/bcard/phone2.png6.87KB4.08KB▼ 40.67%
admin/images/contact.png3.94KB2.21KB▼ 43.87%
admin/images/leader-tweet.png2.62KB1.75KB▼ 33.37%