74% wp-legisearch

Code Review | WP Legisearch

WordPress plugin WP Legisearch scored74%from 54 tests.

About plugin

  • Plugin page: wp-legisearch
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.8.3
  • WordPress version: 6.3.1
  • First release: Nov 4, 2015
  • Latest release: Nov 6, 2017
  • Number of updates: 49
  • Update frequency: every 15.0 days
  • Top authors: drobertsorg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,651 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.24ms] Passed 4 tests

Analyzing server-side resources used by WP Legisearch
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.13 ▲2.26
Dashboard /wp-admin3.32 ▲0.0249.23 ▼1.34
Posts /wp-admin/edit.php3.38 ▲0.0250.63 ▼0.54
Add New Post /wp-admin/post-new.php5.91 ▲0.02100.78 ▼1.34
Media Library /wp-admin/upload.php3.25 ▲0.0238.86 ▲2.39
Add Bill /wp-admin/admin.php?page=legisearch-add-bill3.1929.26
Settings /wp-admin/admin.php?page=legisearch-settings3.2635.88
All Bills /wp-admin/admin.php?page=legisearch-bill3.1930.01

Server storage [IO: ▲0.11MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 38 new files
Database: 3 new tables, 7 new options
New tables
wp_legisearch_os_cache
wp_legisearch_votestracked
wp_legisearch_billstracked
New WordPress options
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
legisearch_openstates_cachetimeout

Browser metrics Passed 4 tests

WP Legisearch: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2914.19 ▼0.171.88 ▲0.1443.51 ▼3.72
Dashboard /wp-admin2,209 ▲295.56 ▼0.1295.01 ▼1.9575.99 ▲34.57
Posts /wp-admin/edit.php2,129 ▲262.01 ▲0.0135.92 ▼2.0733.60 ▼0.69
Add New Post /wp-admin/post-new.php1,563 ▲3722.84 ▼0.25750.70 ▲71.4353.95 ▲1.49
Media Library /wp-admin/upload.php1,423 ▲264.11 ▼0.12108.57 ▲9.2066.58 ▲21.07
Add Bill /wp-admin/admin.php?page=legisearch-add-bill6951.518.1617.61
Settings /wp-admin/admin.php?page=legisearch-settings8982.1829.7731.49
All Bills /wp-admin/admin.php?page=legisearch-bill6951.127.1415.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_legisearch_os_cache
    • wp_legisearch_billstracked
    • wp_legisearch_votestracked
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • legisearch_openstates_cachetimeout
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-legisearch/imagecache/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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 your attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-legisearch === )
The official readme.txt might help

wp-legisearch/legisearch.php 92% from 13 tests

This is the main PHP file of "WP Legisearch" version 1.3.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-legisearch.php" instead of "legisearch.php")

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
No dangerous file extensions were detected2,012 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP282072051,769
JavaScript2104151
CSS36092

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.90
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.48
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods63
▷ Static methods46.35%
▷ Public methods5282.54%
▷ Protected methods11.59%
▷ Private methods1015.87%
Functions33
▷ Named functions33100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants2083.33%
▷ Class constants416.67%
▷ Public constants4100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/wp-icon-36.png1.58KB1.43KB▼ 9.68%
images/wp-icon-16.png0.61KB0.69KB0.00%