84% jamstack-preview-and-deployments

Code Review | Jamstack Preview and Deployments

WordPress plugin Jamstack Preview and Deployments scored 84% from 54 tests.

About plugin

  • Plugin page: jamstack-preview-...
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Sep 10, 2020
  • Latest release: Sep 16, 2020
  • Number of updates: 8
  • Update frequency: every 0.8 days
  • Top authors: emilpriver (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 533 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.40ms] Passed 4 tests

A check of server-side resources used by Jamstack Preview and Deployments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.93 ▼1.42
Dashboard /wp-admin3.39 ▲0.0851.57 ▲2.96
Posts /wp-admin/edit.php3.50 ▲0.1448.72 ▲0.36
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.10 ▼27.48
Media Library /wp-admin/upload.php3.31 ▲0.0838.27 ▲3.88
Jamstack preview and deployments /wp-admin/options-general.php?page=jamstack-preview-and-deployments3.2831.22

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Jamstack Preview and Deployments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲8813.32 ▼1.091.67 ▼0.0244.17 ▲6.10
Dashboard /wp-admin2,223 ▲325.83 ▲0.89102.35 ▼2.1436.68 ▼3.70
Posts /wp-admin/edit.php2,109 ▲232.01 ▼0.0238.48 ▲2.9433.67 ▲3.07
Add New Post /wp-admin/post-new.php1,546 ▲1223.09 ▼0.12614.91 ▼24.9750.44 ▼9.24
Media Library /wp-admin/upload.php1,405 ▲144.23 ▼0.0396.99 ▼23.5342.88 ▼7.57
Jamstack preview and deployments /wp-admin/options-general.php?page=jamstack-preview-and-deployments1,3292.0525.4730.42

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jamstack-preview-and-deployments/actions.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_queried_object() in wp-content/plugins/jamstack-preview-and-deployments/preview/template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jamstack-preview-and-deployments/admin-bar.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/jamstack-preview-and-deployments/jamstack-preview-and-deployments.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/jamstack-preview-and-deployments/preview/preview.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/jamstack-preview-and-deployments/admin/admin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: jamstack, nextjs, preview, deployments

jamstack-preview-and-deployments/jamstack-preview-and-deployments.php Passed 13 tests

Analyzing the main PHP file in "Jamstack Preview and Deployments" version 1.1.1
85 characters long description:
Enable preview and deployments from the wordpress admin to your JAMstack application.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected521 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP955155480
JavaScript11019
Markdown1509
CSS1008
JSON1005

PHP code Passed 2 tests

Analyzing 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.24
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%
Functions24
▷ Named functions2187.50%
▷ Anonymous functions312.50%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected