52% ajax-table-with-custom-crud-api

Code Review | AJAX Table with Custom CRUD API

WordPress plugin AJAX Table with Custom CRUD API scored52%from 54 tests.

About plugin

  • Plugin page: ajax-table-with-c...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5
  • WordPress version: 6.3.1
  • First release: Oct 9, 2020
  • Latest release: Oct 9, 2020
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: shajeebs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /984 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.01MB] [CPU: ▼43.18ms] Passed 4 tests

An overview of server-side resources used by AJAX Table with Custom CRUD API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.97 ▼0.5017.53 ▼24.04
Dashboard /wp-admin3.01 ▼0.3016.88 ▼37.84
Posts /wp-admin/edit.php3.01 ▼0.3517.70 ▼29.79
Add New Post /wp-admin/post-new.php3.01 ▼2.8818.19 ▼81.04
Media Library /wp-admin/upload.php3.01 ▼0.2316.61 ▼18.63
AJDT Short Codes /wp-admin/admin.php?page=ajdtshortcodes3.0117.20
AJDT Settings /wp-admin/admin.php?page=ajdtsettings3.0116.29

Server storage [IO: ▲0.84MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please fix the following
  • You have illegally modified 1 file (4.00KB) outside of "wp-content/plugins/ajax-table-with-custom-crud-api/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 26 new files
Database: 1 new table, 6 new options
New tables
wp_ajdt_utils
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for AJAX Table with Custom CRUD API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲10613.65 ▼0.931.81 ▲0.2227.64 ▼12.33
Dashboard /wp-admin2,270 ▲675.42 ▲0.56115.37 ▲9.6149.79 ▲9.05
Posts /wp-admin/edit.php2,152 ▲522.57 ▲0.5540.40 ▲0.7339.06 ▲3.46
Add New Post /wp-admin/post-new.php1,727 ▲20123.22 ▲5.67698.01 ▲17.9944.24 ▼20.21
Media Library /wp-admin/upload.php1,452 ▲524.75 ▲0.52112.05 ▲3.5049.52 ▲2.64
AJDT Short Codes /wp-admin/admin.php?page=ajdtshortcodes9142.2027.5140.65
AJDT Settings /wp-admin/admin.php?page=ajdtsettings1,4342.6258.7459.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.)
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_ajdt_utils
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ajdtsettings
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. REST API routes must be registered on the rest_api_init action. Please see Debugging in WordPress for more information. (This message was added in version 5.1.0.)
    • > GET request to /wp-admin/admin.php?page=ajdtshortcodes
    • > Warning in wp-content/plugins/ajax-table-with-custom-crud-api/includes/class-general-util.php+53
    Invalid argument supplied for foreach()

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ajax-table-with-custom-crud-api/includes/class-ui.php
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/ajax-table-with-custom-crud-api/includes/class-api-registrar.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ajax-table-with-custom-crud-api/ajdttable.php:85
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/ajax-table-with-custom-crud-api/includes/class-api-utils.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: data filters, bootstrap, crud api, crud operations, filters...

ajax-table-with-custom-crud-api/ajdttable.php 77% from 13 tests

"AJAX Table with Custom CRUD API" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ajax-table-with-custom-crud-api.php" instead of "ajdttable.php")
  • Description: The description should be shorter than 140 characters (currently 213 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin1,412 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP8160370932
JavaScript83844362
CSS581765
Markdown116053

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity10.83
▷ Minimum class complexity1.00
▷ Maximum class complexity37.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods51
▷ Static methods23.92%
▷ Public methods4996.08%
▷ Protected methods11.96%
▷ Private methods11.96%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
No PNG files were detected