79% advanced-image-sitemap

Code Review | Advanced Image Sitemap

WordPress plugin Advanced Image Sitemap scored 79% from 54 tests.

About plugin

  • Plugin page: advanced-image-si...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-3.4
  • WordPress version: 5.9.2
  • First release: Nov 30, 2015
  • Latest release: Dec 9, 2016
  • Number of updates: 10
  • Update frequency: every 50.6 days
  • Top authors: makong (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 5,830 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼1.16MB] [CPU: ▼325.03ms] Passed 4 tests

A check of server-side resources used by Advanced Image Sitemap
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0861.48 ▲4.03
Dashboard /wp-admin3.17 ▼0.2423.35 ▼13.06
Posts /wp-admin/edit.php3.17 ▼0.4719.85 ▼21.72
Add New Post /wp-admin/post-new.php3.17 ▼3.8018.98 ▼1,257.34
Media Library /wp-admin/upload.php3.17 ▼0.1318.76 ▼8.01
AIS /wp-admin/options-general.php?page=ais3.1723.85

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
ais_options

Browser metrics Passed 4 tests

Advanced Image Sitemap: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,788 ▲4616.13 ▲0.466.18 ▲0.482.49 ▲0.18
Dashboard /wp-admin2,897 ▲396.14 ▲0.01117.54 ▼16.51157.69 ▼10.69
Posts /wp-admin/edit.php2,696 ▲83.24 ▲0.0162.05 ▼2.47139.89 ▼3.33
Add New Post /wp-admin/post-new.php1,671 ▼4818.82 ▲1.28403.50 ▼23.38155.43 ▲3.80
Media Library /wp-admin/upload.php1,703 ▲55.54 ▲0.01140.28 ▼0.26190.42 ▼3.82
AIS /wp-admin/options-general.php?page=ais1,3442.4054.19124.96

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
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ais
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+280
    Undefined index: date
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+432
    Undefined index: tags
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+477
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+439
    Undefined index: ctags
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Warning in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+439
    implode(): Invalid arguments passed
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+458
    Undefined index: sizes
    • > GET request to /wp-admin/options-general.php?page=ais
    • > Notice in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php+477
    Undefined index: exclude

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/advanced-image-sitemap/advanced-image-sitemap.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

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
4 plugin tags: image sitemap, custom, seo, sitemap

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

The main PHP script in "Advanced Image Sitemap" version 1.2 is automatically included on every request by WordPress
128 characters long description:
Most advanced plugin for Image Sitemap generator up-to-date. Boost your website indexation in Google (and other) Search Engines.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected929 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34101,933929

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity126.00
▷ Minimum class complexity126.00
▷ Maximum class complexity126.00
Average method complexity6.19
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods1770.83%
▷ Protected methods00.00%
▷ Private methods729.17%
Functions19
▷ Named functions1684.21%
▷ Anonymous functions315.79%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/donate.png12.84KB4.25KB▼ 66.86%
images/remove.png1.09KB0.84KB▼ 23.15%