83% google-sitemap-generator

Code Review | XML Sitemap Generator for Google

WordPress plugin XML Sitemap Generator for Google scored83%from 54 tests.

About plugin

  • Plugin page: google-sitemap-ge...
  • Plugin version: 4.1.13
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Jun 16, 2005
  • Latest release: Aug 11, 2023
  • Number of updates: 558
  • Update frequency: every 11.9 days
  • Top authors: arnee (90.5%)auctollo (6.81%)fredericktownes (3.05%)

Code review

54 tests

User reviews

2155 reviews

Install metrics

1,000,000+ active /36,212,665 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.50ms] 75% from 4 tests

An overview of server-side resources used by XML Sitemap Generator for Google
It is recommended to improve the following
  • CPU: The total CPU usage must kept under 500.00ms (currently 517.80ms on /wp-admin/options-general.php?page=google-sitemap-generator/sitemap.php)
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.93 ▼0.95
Dashboard /wp-admin3.43 ▲0.1251.31 ▼2.70
Posts /wp-admin/edit.php3.47 ▲0.1254.06 ▲3.05
Add New Post /wp-admin/post-new.php5.94 ▲0.0598.73 ▼9.81
Media Library /wp-admin/upload.php3.28 ▲0.0540.41 ▼0.52
XML-Sitemap /wp-admin/options-general.php?page=google-sitemap-generator/sitemap.php4.46517.80

Server storage [IO: ▲2.04MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 89 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_recent-comments
sm_rewrite_done
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
sm_options
widget_recent-posts

Browser metrics Passed 4 tests

XML Sitemap Generator for Google: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲5713.62 ▼0.811.94 ▼0.2634.57 ▼8.27
Dashboard /wp-admin2,249 ▲464.84 ▼0.05106.06 ▼10.4043.19 ▼4.76
Posts /wp-admin/edit.php2,109 ▲92.02 ▲0.0440.12 ▲3.8735.43 ▼0.29
Add New Post /wp-admin/post-new.php1,556 ▲223.26 ▲5.15658.69 ▲4.6176.08 ▲24.66
Media Library /wp-admin/upload.php1,411 ▲144.23 ▼0.03100.26 ▼1.7045.58 ▼1.35
XML-Sitemap /wp-admin/options-general.php?page=google-sitemap-generator/sitemap.php2,5242.2228.2141.60

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • sm_options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/google-sitemap-generator/sitemap.php:53
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/google-sitemap-generator/class-googlesitemapgeneratorloader.php:12

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 18 tag instead of maximum 10
Please take inspiration from this readme.txt

google-sitemap-generator/sitemap.php 85% from 13 tests

The entry point to "XML Sitemap Generator for Google" version 4.1.13 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("google-sitemap-generator.php" instead of "sitemap.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected15,169 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PO File294,5976,89210,127
PHP97971,8334,797
XSLT1130153
JavaScript115392

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 205)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity48.07
▷ Minimum class complexity1.00
▷ Maximum class complexity233.00
Average method complexity4.20
▷ Minimum method complexity1.00
▷ Maximum method complexity205.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes18.33%
Methods203
▷ Static methods6029.56%
▷ Public methods18892.61%
▷ Protected methods31.48%
▷ Private methods125.91%
Functions11
▷ Named functions763.64%
▷ Anonymous functions436.36%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 0.18MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png15.03KB16.40KB0.00%
img/close.png6.95KB7.33KB0.00%
(invalid) img/help.png15.47KB0.00KB▼ 100.00%
screenshot-2.png31.33KB34.42KB0.00%
screenshot-1.png111.75KB34.24KB▼ 69.36%