77% longshot-ai-long-form-writing-assistant

Code Review | LongShot AI - Long Form Writing Assistant

WordPress plugin LongShot AI - Long Form Writing Assistant scored77%from 54 tests.

About plugin

  • Plugin page: longshot-ai-long-...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 14, 2022
  • Latest release: Sep 9, 2022
  • Number of updates: 14
  • Update frequency: every 4.1 days
  • Top authors: longshotai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /1,652 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

A check of server-side resources used by LongShot AI - Long Form Writing Assistant
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2341.11 ▲2.59
Dashboard /wp-admin3.54 ▲0.2451.48 ▲2.59
Posts /wp-admin/edit.php3.66 ▲0.3047.35 ▲0.60
Add New Post /wp-admin/post-new.php6.14 ▲0.25694.02 ▲607.01
Media Library /wp-admin/upload.php3.47 ▲0.2337.15 ▲0.99
Dashboard /wp-admin/admin.php?page=longshot-ai3.4933.49

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 15 new options
New WordPress options
can_compress_scripts
longshot_ai_api_key
longshot_ai_persistent_message
longshot_ai_feedback_message
widget_recent-comments
longshot_ai_unique_id
longshot_ai_feedback_dismissed
db_upgraded
longshot_ai_feedback_given
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

Checking browser requirements for LongShot AI - Long Form Writing Assistant
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲12814.36 ▼0.301.68 ▼0.0845.81 ▲1.13
Dashboard /wp-admin2,298 ▲1185.64 ▼0.0197.42 ▲4.9545.98 ▲2.96
Posts /wp-admin/edit.php2,202 ▲1022.02 ▲0.0236.78 ▲0.4737.26 ▲1.76
Add New Post /wp-admin/post-new.php1,551 ▲1423.51 ▲5.41695.39 ▲41.6047.09 ▼24.00
Media Library /wp-admin/upload.php1,500 ▲1004.23 ▼0.08104.37 ▲11.0145.44 ▲3.52
Dashboard /wp-admin/admin.php?page=longshot-ai1,0402.0122.0833.77

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
Please fix the following items
  • The uninstall procedure has failed, leaving 9 options in the database
    • longshot_ai_feedback_message
    • longshot_ai_feedback_given
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • longshot_ai_feedback_dismissed
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/longshot-ai-long-form-writing-assistant/longshot-ai.php
  • 10× 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/longshot-ai-long-form-writing-assistant/rest.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_transient() in wp-content/plugins/longshot-ai-long-form-writing-assistant/templates/admin-page.php:48
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      A non-numeric value encountered in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25
    • > PHP Warning
      Use of undefined constant DAY_IN_SECONDS - assumed 'DAY_IN_SECONDS' (this will throw an Error in a future version of PHP) in wp-content/plugins/longshot-ai-long-form-writing-assistant/constants.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention: The official readme.txt might help

longshot-ai-long-form-writing-assistant/longshot-ai.php 85% from 13 tests

"LongShot AI - Long Form Writing Assistant" version 2.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("longshot-ai-long-form-writing-assistant.php" instead of "longshot-ai.php")
  • Description: The description should be shorter than 140 characters (currently 249 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,495 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP102001421,255
CSS4344189
SVG10050
JavaScript1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity19.17
▷ Minimum class complexity4.00
▷ Maximum class complexity31.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes6100.00%
Methods65
▷ Static methods913.85%
▷ Public methods5990.77%
▷ Protected methods00.00%
▷ Private methods69.23%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants3
▷ Global constants3100.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
2 compressed PNG files occupy 0.09MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/longshot.png37.41KB33.84KB▼ 9.53%
assets/longshot-mini.png51.97KB48.34KB▼ 7.00%