72% squareoffs

Code Review | SquareOffs

WordPress plugin SquareOffs scored72%from 54 tests.

About plugin

  • Plugin page: squareoffs
  • Plugin version: 2.4.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2017
  • Latest release: Sep 19, 2023
  • Number of updates: 28
  • Update frequency: every 76.7 days
  • Top authors: squareoffs (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,235 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.37MB] [CPU: ▼4.50ms] Passed 4 tests

Analyzing server-side resources used by SquareOffs
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5038.86 ▼2.20
Dashboard /wp-admin3.80 ▲0.5048.70 ▼0.29
Posts /wp-admin/edit.php3.85 ▲0.5049.66 ▲2.63
Add New Post /wp-admin/post-new.php5.87 ▼0.0174.56 ▼18.15
Media Library /wp-admin/upload.php3.73 ▲0.5143.37 ▲12.97
Settings /wp-admin/admin.php?page=squareoffs-options3.7345.44
SquareOffs /wp-admin/admin.php?page=squareoffs3.7354.64

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 80 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for SquareOffs
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲13013.46 ▼1.132.11 ▲0.2739.10 ▼9.23
Dashboard /wp-admin2,259 ▲704.96 ▼0.0098.25 ▼22.7565.23 ▲20.38
Posts /wp-admin/edit.php2,141 ▲522.02 ▲0.0338.87 ▲0.4634.93 ▲4.14
Add New Post /wp-admin/post-new.php6,448 ▲4,91528.15 ▲4.92944.28 ▲277.2644.78 ▼8.82
Media Library /wp-admin/upload.php1,795 ▲40414.36 ▲10.14319.53 ▲223.7568.99 ▲22.59
Settings /wp-admin/admin.php?page=squareoffs-options1,71423.61421.84105.99
SquareOffs /wp-admin/admin.php?page=squareoffs1,65917.89366.0747.73

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/squareoffs/js/templates/tinymce-preview.php
    • > /wp-content/plugins/squareoffs/js/templates/modal-insert-content-default.php
    • > /wp-content/plugins/squareoffs/js/templates/modal-insert.php
    • > /wp-content/plugins/squareoffs/js/templates/modal-insert-content-login.php
    • > /wp-content/plugins/squareoffs/php/templates/iframe.php
    • > /wp-content/plugins/squareoffs/js/templates/modal-insert-content-disconnected.php
  • 44× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/squareoffs/php/templates/iframe.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function squareoffs_get_api() in wp-content/plugins/squareoffs/php/admin/details.php:9
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/squareoffs/php/templates/iframe.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/squareoffs/php/templates/iframe.php on line 12
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/squareoffs/php/templates/iframe.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function squareoffs_get_squareoff_data() in wp-content/plugins/squareoffs/php/admin/edit.php:11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/squareoffs/php/templates/iframe.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/squareoffs/php/admin/list.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/squareoffs/php/admin/options.php:8
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/squareoffs/php/templates/iframe.php on line 23

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
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=squareoffs
    • > Console-api (warning) in wp-content/plugins/squareoffs/build/index.js?ver=990ea6e32208db570c843d3ec9db0c96+19456:10
    You are using a whole package of antd, please use https://www.npmjs.com/package/babel-plugin-import to reduce app bundle size.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=squareoffs
    • > Javascript (severe) in unknown
    /wp-content/plugins/squareoffs/build/index.js?ver=990ea6e32208db570c843d3ec9db0c96 95569:29 Uncaught TypeError: Cannot read properties of undefined (reading 'api_connected')

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% 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
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

squareoffs/plugin.php 85% from 13 tests

The primary PHP file in "SquareOffs" version 2.4.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("squareoffs.php" instead of "plugin.php")
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
No dangerous file extensions were detected75,419 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript818,3989,08371,238
PHP378731,1302,971
CSS8212521,145
Markdown227065

PHP code Passed 2 tests

An overview 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.30
Average class complexity21.67
▷ Minimum class complexity3.00
▷ Maximum class complexity66.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods67
▷ Static methods11.49%
▷ Public methods6292.54%
▷ Protected methods34.48%
▷ Private methods22.99%
Functions71
▷ Named functions7098.59%
▷ Anonymous functions11.41%
Constants4
▷ Global constants4100.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
14 PNG files occupy 0.30MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/wp-datepicker-styling/screenshots/ocean.png28.17KB11.94KB▼ 57.62%
css/wp-datepicker-styling/screenshots/mint.png28.44KB11.79KB▼ 58.56%
css/wp-datepicker-styling/screenshots/fresh.png28.13KB11.88KB▼ 57.79%
css/wp-datepicker-styling/screenshots/evergreen.png28.60KB11.81KB▼ 58.70%
css/wp-datepicker-styling/screenshots/sunrise.png28.15KB11.95KB▼ 57.57%