84% linear

Code Review | Linear

WordPress plugin Linear scored84%from 54 tests.

About plugin

  • Plugin page: linear
  • Plugin version: 2.7.2
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 27, 2021
  • Latest release: Nov 20, 2023
  • Number of updates: 212
  • Update frequency: every 4.9 days
  • Top authors: linearoy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /5,446 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲1.73MB] [CPU: ▲2.37ms] Passed 4 tests

Server-side resources used by Linear
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.24 ▲1.7749.33 ▲9.80
Dashboard /wp-admin5.10 ▲1.7566.01 ▲1.37
Posts /wp-admin/edit.php5.15 ▲1.7968.98 ▲23.39
Add New Post /wp-admin/post-new.php7.59 ▲1.6995.08 ▼9.68
Media Library /wp-admin/upload.php4.93 ▲1.7048.61 ▲8.00
Instructions /wp-admin/admin.php?page=linear-instructions4.9345.88
Debug /wp-admin/admin.php?page=linear-debug4.9346.12
Feedback /wp-admin/admin.php?page=linear-feedback4.9347.65
Advanced usage /wp-admin/admin.php?page=linear-advanced4.9445.51
Settings /wp-admin/admin.php?page=linear-settings4.9450.21

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 235 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Linear
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,565 ▲81824.81 ▲10.4617.36 ▲15.7435.98 ▼8.70
Dashboard /wp-admin2,692 ▲51711.68 ▲6.10184.06 ▲72.3243.25 ▼2.65
Posts /wp-admin/edit.php2,593 ▲4909.30 ▲7.2977.47 ▲36.4931.07 ▼7.87
Add New Post /wp-admin/post-new.php6,288 ▲4,74931.03 ▲8.281,062.59 ▲421.1641.11 ▼6.53
Media Library /wp-admin/upload.php1,805 ▲4058.96 ▲4.93111.91 ▼0.2343.04 ▼7.09
Instructions /wp-admin/admin.php?page=linear-instructions1,4198.8682.2832.62
Debug /wp-admin/admin.php?page=linear-debug1,2968.8573.7226.40
Feedback /wp-admin/admin.php?page=linear-feedback1,2937.9574.0526.89
Advanced usage /wp-admin/admin.php?page=linear-advanced2,67510.05125.5743.99
Settings /wp-admin/admin.php?page=linear-settings1,9898.34115.0539.84

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/linear/blocks/listings/listings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/linear/templates/linear-404.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/linear/includes/constants_and_labels.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Sitemaps_Provider' not found in wp-content/plugins/linear/includes/class-linear-sitemaps.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Linear\\Templates\\get_header() in wp-content/plugins/linear/templates/plain-listings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/linear/blocks/buy-commissions/buy-commissions.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: gutenberg, real estate, retail agency, apartments, blocks

linear/linear.php Passed 13 tests

"Linear" version 2.7.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
116 characters long description:
Linear listing system WordPress plugin. Enables you to easily display all your real estate listings on your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin15,699 lines of code in 200 files:
LanguageFilesBlank linesComment linesLines of code
PHP831,9631,4127,672
JavaScript556803493,962
PO File18471,0212,382
Sass7219131,089
JSON800548
SVG400040
CSS6186

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity60.80
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity4.96
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods216
▷ Static methods3516.20%
▷ Public methods14165.28%
▷ Protected methods10.46%
▷ Private methods7434.26%
Functions116
▷ Named functions7060.34%
▷ Anonymous functions4639.66%
Constants3
▷ Global constants3100.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
4 compressed PNG files occupy 0.23MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/map_bg.png222.68KB224.83KB0.00%
dist/bg-dixu.png6.62KB6.88KB0.00%
dist/linear-logo-128x128.png1.55KB1.55KB0.19%
dist/linear-logo-256x256.png2.78KB2.78KB0.04%