78% xml-sitemap-generator-for-google

Code Review | Dynamic XML Sitemaps Generator for Google

WordPress plugin Dynamic XML Sitemaps Generator for Google scored78%from 54 tests.

About plugin

  • Plugin page: xml-sitemap-gener...
  • Plugin version: 1.7.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 17, 2021
  • Latest release: Nov 15, 2023
  • Number of updates: 92
  • Update frequency: every 10.9 days
  • Top authors: wpgrim (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

10,000+ active /317,441 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.43MB] [CPU: ▼3.52ms] Passed 4 tests

A check of server-side resources used by Dynamic XML Sitemaps Generator for Google
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.42695.31 ▲656.60
Dashboard /wp-admin3.79 ▲0.4549.39 ▼9.41
Posts /wp-admin/edit.php3.84 ▲0.4952.18 ▲7.36
Add New Post /wp-admin/post-new.php6.31 ▲0.4284.87 ▼16.13
Media Library /wp-admin/upload.php3.65 ▲0.4237.58 ▲4.10
XML Sitemaps /wp-admin/options-general.php?page=xml-sitemap-generator-for-google3.6945.78

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 64 new files
Database: no new tables, 9 new options
New WordPress options
xml-sitemap-generator-for-google-last-ping
widget_recent-comments
theysaidso_admin_options
grim_sg_rules
db_upgraded
widget_theysaidso_widget
category_children
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Dynamic XML Sitemaps Generator for Google
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,784 ▲3714.69 ▲0.561.61 ▼0.1845.78 ▲0.42
Dashboard /wp-admin2,202 ▲385.65 ▼0.0691.61 ▼20.1640.64 ▼1.45
Posts /wp-admin/edit.php2,107 ▲71.95 ▼0.0140.44 ▲1.3336.42 ▲0.19
Add New Post /wp-admin/post-new.php1,529 ▲323.46 ▲0.26697.60 ▼5.1561.91 ▼1.45
Media Library /wp-admin/upload.php1,404 ▲44.12 ▼0.0594.67 ▼8.2941.50 ▼1.09
XML Sitemaps /wp-admin/options-general.php?page=xml-sitemap-generator-for-google3,5552.9655.2575.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • grim_sg_rules
    • category_children
    • xml-sitemap-generator-for-google-last-ping
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/xml-sitemap-generator-for-google/templates/xsl/tables/google-news.php
    • > /wp-content/plugins/xml-sitemap-generator-for-google/templates/xsl/tables/image-sitemap.php
    • > /wp-content/plugins/xml-sitemap-generator-for-google/templates/xsl/tables/sitemap.php
    • > /wp-content/plugins/xml-sitemap-generator-for-google/templates/xsl/tables/video-sitemap.php
    • > /wp-content/plugins/xml-sitemap-generator-for-google/templates/xsl/tables/sitemap-index.php
  • 45× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/xml-sitemap-generator-for-google/templates/fields/select.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/xml-sitemap-generator-for-google/templates/fields/radio.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/xml-sitemap-generator-for-google/templates/sections/general/general-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/xml-sitemap-generator-for-google/templates/fields/checkbox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/xml-sitemap-generator-for-google/templates/sections/google-news/stock-tickers.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/xml-sitemap-generator-for-google/templates/sections/advanced/cache.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'GRIM_SG\\Vendor\\Controller' not found in wp-content/plugins/xml-sitemap-generator-for-google/includes/Notices.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/xml-sitemap-generator-for-google/templates/sections/google-news/general-settings.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/xml-sitemap-generator-for-google/templates/fields/content.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/xml-sitemap-generator-for-google/templates/sections/media-sitemaps/image-sitemap.php:11

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
You can take inspiration from this readme.txt

xml-sitemap-generator-for-google/xml-sitemap-generator-for-google.php 92% from 13 tests

"Dynamic XML Sitemaps Generator for Google" version 1.7.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 172 characters long)

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
No dangerous file extensions were detected4,198 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP586053953,752
CSS13118284
JavaScript33812162

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity20.67
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.89
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes15
▷ Abstract classes16.67%
▷ Concrete classes1493.33%
▷ Final classes00.00%
Methods104
▷ Static methods2019.23%
▷ Public methods10298.08%
▷ Protected methods00.00%
▷ Private methods21.92%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants675.00%
▷ Class constants225.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected