78% synfield-smart-agriculture

Code Review | SynField Smart Agriculture

WordPress plugin SynField Smart Agriculture scored78%from 54 tests.

About plugin

  • Plugin page: synfield-smart-ag...
  • Plugin version: 0.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.4-5.2.4
  • WordPress version: 6.3.1
  • First release: Nov 19, 2019
  • Latest release: Dec 14, 2019
  • Number of updates: 11
  • Update frequency: every 2.3 days
  • Top authors: synelixis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /544 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼1.86ms] Passed 4 tests

A check of server-side resources used by SynField Smart Agriculture
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2044.51 ▲1.16
Dashboard /wp-admin3.56 ▲0.2649.32 ▲1.76
Posts /wp-admin/edit.php3.61 ▲0.2549.56 ▼1.80
Add New Post /wp-admin/post-new.php6.10 ▲0.2188.89 ▼8.56
Media Library /wp-admin/upload.php3.42 ▲0.1940.35 ▲8.59
SynField Smart Agriculture /wp-admin/options-general.php?page=synfield-smart-agriculture3.3931.84

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_synfield_smart_agriculture_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
synfield_app_key_error
synfield_app_key

Browser metrics Passed 4 tests

SynField Smart Agriculture: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲11415.76 ▲1.4510.48 ▲8.5043.59 ▼5.10
Dashboard /wp-admin2,214 ▲294.84 ▼1.01109.93 ▲9.0638.52 ▼5.18
Posts /wp-admin/edit.php2,097 ▲52.00 ▼0.0639.69 ▼6.8234.82 ▼3.85
Add New Post /wp-admin/post-new.php1,521 ▼1523.37 ▲0.24664.52 ▲24.9462.89 ▲2.75
Media Library /wp-admin/upload.php1,390 ▲24.24 ▼0.03106.85 ▲10.6945.78 ▲4.07
SynField Smart Agriculture /wp-admin/options-general.php?page=synfield-smart-agriculture8312.2024.6428.61

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/synfield-smart-agriculture/synfield-smart-agriculture.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/synfield-smart-agriculture/templates/admin.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SynField\\Base\\BaseController' not found in wp-content/plugins/synfield-smart-agriculture/include/Base/SettingsLinks.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SynField\\Base\\BaseController' not found in wp-content/plugins/synfield-smart-agriculture/include/Base/Enqueue.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/synfield-smart-agriculture/include/Api/Widgets/SmartAgricultureWidget.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'SynField\\Base\\BaseController' not found in wp-content/plugins/synfield-smart-agriculture/include/Api/Callbacks/AdminCallbacks.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'SynField\\Base\\BaseController' not found in wp-content/plugins/synfield-smart-agriculture/include/Pages/Admin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'SynField\\Base\\BaseController' not found in wp-content/plugins/synfield-smart-agriculture/include/Base/WidgetController.php:16

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === synfield-smart-agriculture === )
The official readme.txt might help

synfield-smart-agriculture/synfield-smart-agriculture.php Passed 13 tests

"SynField Smart Agriculture" version 0.2.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
60 characters long description:
Enable the data visualization of SynField nodes in a widget.

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 plugin6,058 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
SVG1044,663
PHP221945371,045
PO File27373180
CSS3225121
JavaScript36519
JSON20018
Markdown14012

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.31
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes17.14%
Methods76
▷ Static methods1215.79%
▷ Public methods6078.95%
▷ Protected methods00.00%
▷ Private methods1621.05%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin