94% advanced-image-styles

Code Review | Advanced Image Styles

WordPress plugin Advanced Image Styles scored 94% 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: 5.9.2
  • 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

64 reviews

Install metrics

20,000+ active / 140,087 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Advanced Image Styles
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0164.82 ▲8.87
Dashboard /wp-admin3.41 ▲0.0155.88 ▲19.63
Posts /wp-admin/edit.php3.65 ▲0.0141.18 ▼34.59
Add New Post /wp-admin/post-new.php6.89 ▼0.0896.06 ▼1,181.51
Media Library /wp-admin/upload.php3.30 ▲0.0053.14 ▲27.29

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, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Image Styles
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲5115.92 ▲0.135.57 ▼2.572.43 ▲0.42
Dashboard /wp-admin2,895 ▲356.19 ▲0.03115.86 ▼10.96158.69 ▼4.17
Posts /wp-admin/edit.php2,670 ▼183.25 ▲0.0295.66 ▲21.80151.79 ▲10.72
Add New Post /wp-admin/post-new.php1,767 ▲9321.90 ▲0.41448.99 ▲45.11159.24 ▲3.91
Media Library /wp-admin/upload.php1,702 ▲15.53 ▲0.06153.10 ▲16.23301.04 ▲111.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

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
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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > 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
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: editor, formatting, photo, image, tinymce

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

The main PHP file in "Advanced Image Styles" ver. 0.4.1 adds more information about the plugin and also serves as the entry point for this plugin
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
Success! There were no dangerous files found in this plugin226 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1280120
PHP2101554
CSS110052

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin