84% wp-lawyer

Code Review | WP Lawyer

WordPress plugin WP Lawyer scored 84% from 54 tests.

About plugin

  • Plugin page: wp-lawyer
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.2.1
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Sep 4, 2015
  • Number of updates: 11
  • Update frequency: every 42.1 days
  • Top authors: bhubbard (63.64%)imforza (45.45%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active / 2,638 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▲1.34ms] Passed 4 tests

An overview of server-side resources used by WP Lawyer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2042.52 ▼1.07
Dashboard /wp-admin3.49 ▲0.1851.69 ▲4.93
Posts /wp-admin/edit.php3.54 ▲0.1855.03 ▲8.25
Add New Post /wp-admin/post-new.php6.08 ▲0.1989.75 ▼6.77
Media Library /wp-admin/upload.php3.41 ▲0.1844.77 ▲12.74
States of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-state&post_type=wplawyer-attorney3.4036.42
Associations /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-associations&post_type=wplawyer-attorney3.4037.25
Undergraduate Schools /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-undergrad&post_type=wplawyer-attorney3.4037.45
Law Schools /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-lawschool&post_type=wplawyer-attorney3.4037.03
All Attorneys /wp-admin/edit.php?post_type=wplawyer-attorney3.4638.59
Areas of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-practice-area&post_type=wplawyer-attorney3.4037.03
Court Houses /wp-admin/edit-tags.php?taxonomy=wplawyer-cases-courthouse&post_type=wplawyer-cases3.4036.48
Cities of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-city&post_type=wplawyer-attorney3.4036.50
Languages /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-languages&post_type=wplawyer-attorney3.4038.01
Add Case /wp-admin/post-new.php?post_type=wplawyer-cases3.5457.93

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
wplawyer-case-resolution_children
theysaidso_admin_options

Browser metrics Passed 4 tests

WP Lawyer: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲16213.35 ▼1.054.21 ▲2.2839.77 ▼8.18
Dashboard /wp-admin2,309 ▲1215.85 ▲0.97101.07 ▼2.3173.64 ▲34.59
Posts /wp-admin/edit.php2,189 ▲1002.02 ▲0.0140.42 ▲4.0840.62 ▲3.79
Add New Post /wp-admin/post-new.php1,750 ▲21622.41 ▼0.73610.38 ▼72.2956.82 ▼0.58
Media Library /wp-admin/upload.php1,485 ▲1004.17 ▼0.0898.78 ▼1.6364.68 ▲22.54
States of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-state&post_type=wplawyer-attorney1,3372.1529.2032.13
Associations /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-associations&post_type=wplawyer-attorney1,3372.1526.3030.87
Undergraduate Schools /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-undergrad&post_type=wplawyer-attorney1,3342.1528.0231.42
Law Schools /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-lawschool&post_type=wplawyer-attorney1,3372.1525.6530.40
All Attorneys /wp-admin/edit.php?post_type=wplawyer-attorney1,2312.0130.1227.65
Areas of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-practice-area&post_type=wplawyer-attorney1,3652.1327.1229.78
Court Houses /wp-admin/edit-tags.php?taxonomy=wplawyer-cases-courthouse&post_type=wplawyer-cases1,3342.1524.7930.42
Cities of Practice /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-city&post_type=wplawyer-attorney1,3342.1524.6829.64
Languages /wp-admin/edit-tags.php?taxonomy=wplawyer-attorney-languages&post_type=wplawyer-attorney1,3372.1529.2328.56
Add Case /wp-admin/post-new.php?post_type=wplawyer-cases2,7657.83174.98122.22

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 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 did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • wplawyer-case-resolution_children
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-lawyer/templates/archive-wplawyer-cases.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-lawyer/templates/single-wplawyer-attorney.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/wp-lawyer/modules/attorneys.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-lawyer/templates/single-wplawyer-cases.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/wp-lawyer/modules/attorneys.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/wp-lawyer/templates/archive-wplawyer-attorney.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/wp-lawyer/modules/cases.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: attorneys, lawyers, law firm

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

This is the main PHP file of "WP Lawyer" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Domain Path: The domain path points to an invalid folder, "/languages/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,112 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP83191801,058
CSS111051
Markdown1103

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions54
▷ Named functions54100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cases-icon.png4.44KB0.61KB▼ 86.31%
assets/images/social-icons.png6.10KB3.04KB▼ 50.11%
assets/images/attorney-icon.png4.65KB0.81KB▼ 82.60%