61% wordpress-seo

Code Review | Yoast SEO

WordPress plugin Yoast SEO scored 61% from 54 tests.

About plugin

  • Plugin page: wordpress-seo
  • Plugin version: 18.5.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.9
  • WordPress version: 5.9.2
  • First release: Oct 11, 2010
  • Latest release: Apr 5, 2022
  • Number of updates: 1,269
  • Update frequency: every 3.8 days
  • Top authors: Yoast (46.89%)joostdevalk (30.81%)jipmoors (7.01%)atimmer (6.15%)DeFries (3.31%)

Code review

54 tests

User reviews

27456 reviews

Install metrics

5,000,000+ active / 412,300,155 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲8.20MB] [CPU: ▼237.13ms] 50% from 4 tests

A check of server-side resources used by Yoast SEO
Please have a look at the following items
  • RAM: Try to keep total memory usage under 10MB (currently 14.20MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 8.20MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
PageMemory (MB)CPU Time (ms)
Home /11.25 ▲7.74118.69 ▲60.66
Dashboard /wp-admin11.52 ▲8.11106.74 ▲66.96
Posts /wp-admin/edit.php12.53 ▲8.90102.81 ▲60.79
Add New Post /wp-admin/post-new.php17.06 ▲10.09195.80 ▼1,133.48
Media Library /wp-admin/upload.php11.35 ▲8.0597.05 ▲63.52
Premium /wp-admin/admin.php?page=wpseo_licenses11.4995.24
General /wp-admin/admin.php?page=wpseo_dashboard11.7987.53
Search Appearance /wp-admin/admin.php?page=wpseo_titles11.9092.41
Tools /wp-admin/admin.php?page=wpseo_tools12.18102.46
Search Console /wp-admin/admin.php?page=wpseo_search_console11.6874.01
Social /wp-admin/admin.php?page=wpseo_social11.7180.40
Workouts /wp-admin/admin.php?page=wpseo_workouts11.4779.22
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php14.2099.46

Server storage [IO: ▲10.36MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,237 new files
Database: 5 new tables, 6 new options
New tables
wp_yoast_migrations
wp_yoast_seo_links
wp_yoast_indexable_hierarchy
wp_yoast_indexable
wp_yoast_primary_term
New WordPress options
wpseo_social
yoast_migrations_free
widget_recent-posts
wpseo
wpseo_titles
widget_recent-comments

Browser metrics Passed 4 tests

Yoast SEO: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,628 ▲88019.88 ▲4.448.22 ▼1.483.84 ▲0.80
Dashboard /wp-admin3,644 ▲7718.90 ▲2.38221.35 ▲48.79257.57 ▲49.82
Posts /wp-admin/edit.php3,233 ▲5483.52 ▲0.1083.05 ▲9.38193.48 ▲14.05
Add New Post /wp-admin/post-new.php2,832 ▲1,19232.37 ▲13.56917.16 ▲355.97310.49 ▲109.71
Media Library /wp-admin/upload.php1,924 ▲2276.09 ▲0.37157.33 ▼17.10239.02 ▲1.58
Premium /wp-admin/admin.php?page=wpseo_licenses2,23313.03250.68198.10
General /wp-admin/admin.php?page=wpseo_dashboard2,89014.65232.58269.09
Search Appearance /wp-admin/admin.php?page=wpseo_titles4,68822.37495.38299.61
Tools /wp-admin/admin.php?page=wpseo_tools1,87613.23192.27217.50
Search Console /wp-admin/admin.php?page=wpseo_search_console1,70012.74185.89148.19
Social /wp-admin/admin.php?page=wpseo_social2,32414.72215.38216.24
Workouts /wp-admin/admin.php?page=wpseo_workouts2,01616.58330.63187.02
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php7,47120.43580.98231.75

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_yoast_indexable_hierarchy
    • wp_yoast_seo_links
    • wp_yoast_migrations
    • wp_yoast_primary_term
    • wp_yoast_indexable
  • The uninstall procedure has failed, leaving 5 options in the database
    • widget_recent-comments
    • yoast_migrations_free
    • wpseo_social
    • wpseo_titles
    • widget_recent-posts

Smoke tests 25% 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/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

SRP 0% 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
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/image.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/recipe.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/recipe-description.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/cooking-time.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/recipe-instructions.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/preparation-time.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/recipe-name.schema.php
    • > /wp-content/plugins/wordpress-seo/src/schema-templates/recipe-ingredients.schema.php
  • 604× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Yoast\\WP\\SEO\\Integrations\\Integration_Interface' not found in wp-content/plugins/wordpress-seo/src/integrations/admin/configuration-workout-integration.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Yoast\\WP\\SEO\\Generators\\Schema\\Abstract_Schema_Piece' not found in wp-content/plugins/wordpress-seo/src/generators/schema/article.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPSEO_Abstract_Capability_Manager' not found in wp-content/plugins/wordpress-seo/admin/capabilities/class-capability-manager-vip.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'WPSEO_Sitemap_Cache_Data_Interface' not found in wp-content/plugins/wordpress-seo/inc/sitemaps/class-sitemap-cache-data.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WPSEO_Bulk_List_Table' not found in wp-content/plugins/wordpress-seo/admin/class-bulk-title-editor-list-table.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Yoast\\WP\\SEO\\Integrations\\Integration_Interface' not found in wp-content/plugins/wordpress-seo/src/integrations/front-end/redirects.php:15
    • > PHP Notice
      Undefined variable: notifications_data in wp-content/plugins/wordpress-seo/admin/views/partial-notifications-warnings.php on line 18
    • > PHP Fatal error
      Uncaught Error: Interface 'Yoast\\WP\\SEO\\Integrations\\Integration_Interface' not found in wp-content/plugins/wordpress-seo/src/integrations/watchers/indexable-static-home-page-watcher.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Yoast\\WP\\SEO\\Actions\\Indexing\\Abstract_Indexing_Action' not found in wp-content/plugins/wordpress-seo/src/actions/indexing/abstract-link-indexing-action.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Yoast\\WP\\SEO\\Integrations\\Integration_Interface' not found in wp-content/plugins/wordpress-seo/src/integrations/blocks/block-categories.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: readability, xml sitemap, seo, content analysis, schema

wordpress-seo/wp-seo.php 85% from 13 tests

The entry point to "Yoast SEO" version 18.5.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")
  • Main file name: Name the main plugin file the same as the plugin slug ("wordpress-seo.php" instead of "wp-seo.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin66,062 lines of code in 1,221 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,00115,36655,11865,230
JavaScript13462470455
XSLT100145
SVG290096
CSS540056
XML10044
Markdown121036

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,228)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity11.20
▷ Minimum class complexity1.00
▷ Maximum class complexity2,228.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces99
Interfaces60
Traits17
Classes826
▷ Abstract classes364.36%
▷ Concrete classes79095.64%
▷ Final classes293.67%
Methods5,520
▷ Static methods5209.42%
▷ Public methods3,64466.01%
▷ Protected methods1,24522.55%
▷ Private methods63111.43%
Functions251
▷ Named functions11345.02%
▷ Anonymous functions13854.98%
Constants404
▷ Global constants133.22%
▷ Class constants39196.78%
▷ Public constants391100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.14MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/man_with_tablet.png10.04KB10.83KB0.00%
images/Assistent_Time_bubble_500x570.png43.54KB19.06KB▼ 56.22%
images/stale-cornerstone-content-in-yoast-seo.png23.63KB14.98KB▼ 36.60%
images/question-mark.png0.24KB0.29KB0.00%
images/profile-social-fields.png67.09KB30.91KB▼ 53.93%