84% smart-crop-image-ai

Code Review | Smart Image Crop AI

WordPress plugin Smart Image Crop AI scored84%from 54 tests.

About plugin

  • Plugin page: smart-crop-image-ai
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1.0-5.8.2
  • WordPress version: 6.3.1
  • First release: Jan 6, 2022
  • Latest release: Jan 6, 2022
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: bcupham (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /387 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
Installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.15ms] Passed 4 tests

Analyzing server-side resources used by Smart Image Crop AI
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.09 ▲6.44
Dashboard /wp-admin3.42 ▲0.1149.77 ▲5.33
Posts /wp-admin/edit.php3.53 ▲0.1745.28 ▼1.17
Add New Post /wp-admin/post-new.php6.00 ▲0.1282.37 ▼2.77
Media Library /wp-admin/upload.php3.34 ▲0.1133.74 ▼0.78
Smart Image Crop /wp-admin/tools.php?page=smartcropai3.3130.28

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smart Image Crop AI
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6615.25 ▲0.701.74 ▲0.0846.05 ▲3.05
Dashboard /wp-admin2,218 ▲366.15 ▲0.34113.37 ▲10.7940.78 ▼2.19
Posts /wp-admin/edit.php2,096 ▲71.97 ▼0.0434.68 ▼1.9531.64 ▼4.94
Add New Post /wp-admin/post-new.php1,517 ▼217.68 ▼5.50671.69 ▼25.0251.33 ▼14.77
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.1393.90 ▼6.1144.04 ▼1.87
Smart Image Crop /wp-admin/tools.php?page=smartcropai8903.6361.2433.63

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/smart-crop-image-ai/smart-crop-image-ai.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'SmartCrop_WP_Base' not found in wp-content/plugins/smart-crop-image-ai/src/class-smartcrop-plugin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SmartCrop_WP_Base' not found in wp-content/plugins/smart-crop-image-ai/src/class-smartcrop-settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: crop images, images, resize images

smart-crop-image-ai/smart-crop-image-ai.php 92% from 13 tests

"Smart Image Crop AI" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin650 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP815860634
JSON10014
CSS1011
JavaScript1021

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.17
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods53
▷ Static methods611.32%
▷ Public methods4788.68%
▷ Protected methods47.55%
▷ Private methods23.77%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants228.57%
▷ Class constants571.43%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin