84% media-sitemap

Code Review | Media Sitemap for Google

WordPress plugin Media Sitemap for Google scored84%from 54 tests.

About plugin

  • Plugin page: media-sitemap
  • Plugin version: 2.03
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Sep 6, 2017
  • Latest release: Oct 29, 2023
  • Number of updates: 52
  • Update frequency: every 43.2 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /4,866 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.03ms] Passed 4 tests

A check of server-side resources used by Media Sitemap for Google
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1437.87 ▼2.55
Dashboard /wp-admin3.43 ▲0.1346.10 ▼5.38
Posts /wp-admin/edit.php3.55 ▲0.1949.04 ▼0.01
Add New Post /wp-admin/post-new.php6.01 ▲0.1380.07 ▼12.09
Media Library /wp-admin/upload.php3.36 ▲0.1334.18 ▼0.08
Media Sitemap for Google /wp-admin/options-general.php?page=MediaSitemap3.3232.16

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
msfg_mime_types
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Media Sitemap for Google
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.27 ▼0.081.66 ▼0.0640.69 ▼8.24
Dashboard /wp-admin2,202 ▲225.61 ▼0.0387.58 ▼1.0438.52 ▼6.35
Posts /wp-admin/edit.php2,104 ▲71.97 ▼0.0439.54 ▲4.6035.01 ▼3.41
Add New Post /wp-admin/post-new.php1,537 ▲1123.06 ▼0.61668.01 ▼4.6450.95 ▼11.10
Media Library /wp-admin/upload.php1,407 ▲74.19 ▼0.0396.34 ▼1.1442.09 ▼1.66
Media Sitemap for Google /wp-admin/options-general.php?page=MediaSitemap9312.0124.6831.31

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-sitemap/lib/class-mediasitemapadmin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/media-sitemap/lib/class-mediasitemap.php:738
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-sitemap/lib/class-mediasitemapadmin.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 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: images, seo, sitemap, google, videos

media-sitemap/mediasitemap.php 92% from 13 tests

The main file in "Media Sitemap for Google" v. 2.03 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("media-sitemap.php" instead of "mediasitemap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin797 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP4130226797

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity34.50
▷ Minimum class complexity23.00
▷ Maximum class complexity46.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1463.64%
▷ Protected methods00.00%
▷ Private methods836.36%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.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