84% advanced-image-styles

Code Review | Advanced Image Styles

WordPress plugin Advanced Image Styles scored84%from 54 tests.

About plugin

  • Plugin page: advanced-image-st...
  • Plugin version: 0.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 6.3.1
  • First release: Apr 17, 2014
  • Latest release: Feb 10, 2018
  • Number of updates: 11
  • Update frequency: every 126.8 days
  • Top authors: gcorne (100%)

Code review

54 tests

User reviews

65 reviews

Install metrics

10,000+ active /144,235 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.71ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Image Styles
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.31 ▼8.33
Dashboard /wp-admin3.32 ▲0.0145.39 ▼1.35
Posts /wp-admin/edit.php3.37 ▲0.0149.47 ▲2.90
Add New Post /wp-admin/post-new.php5.90 ▲0.0291.89 ▼4.73
Media Library /wp-admin/upload.php3.24 ▲0.0134.59 ▼0.41

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Image Styles
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.20 ▼1.101.69 ▼0.0341.32 ▼3.77
Dashboard /wp-admin2,209 ▲214.86 ▼0.0996.61 ▼7.5138.75 ▼4.29
Posts /wp-admin/edit.php2,086 ▼62.04 ▲0.0239.02 ▼0.9735.11 ▼0.53
Add New Post /wp-admin/post-new.php1,521 ▼723.60 ▲5.40596.10 ▼18.1654.37 ▼6.42
Media Library /wp-admin/upload.php1,391 ▼04.16 ▼0.0794.75 ▼3.2341.90 ▼4.82

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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 take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-image-styles/_inc/advanced-image-styles-tmpl.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-image-styles/advanced-image-styles.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: formatting, tinymce, editor, image, photo

advanced-image-styles/advanced-image-styles.php Passed 13 tests

The entry point to "Advanced Image Styles" version 0.4.1 is a PHP file that has certain tags in its header comment area
68 characters long description:
Adjust an image's margins and border with ease in the Visual editor.

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 detected226 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1280120
PHP2101554
CSS110052

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.06
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods4100.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin