10% siteattention

Code Review | SiteAttention SEO

WordPress plugin SiteAttention SEO scored10%from 54 tests.

About plugin

  • Plugin page: siteattention
  • Plugin version: 3.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.4
  • WordPress version: 6.3.1
  • First release: May 11, 2017
  • Latest release: Sep 23, 2020
  • Number of updates: 56
  • Update frequency: every 22.0 days
  • Top authors: siteattention (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,947 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/siteattention/siteattention.php+341
    Undefined variable: response

Server metrics [RAM: ▼1.80MB] [CPU: ▼61.14ms] Passed 4 tests

Server-side resources used by SiteAttention SEO
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.20 ▼1.275.77 ▼38.62
Dashboard /wp-admin2.22 ▼1.137.83 ▼58.06
Posts /wp-admin/edit.php2.22 ▼1.146.53 ▼46.99
Add New Post /wp-admin/post-new.php2.22 ▼3.676.78 ▼100.87
Media Library /wp-admin/upload.php2.22 ▼1.027.02 ▼33.24

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 46 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
SiteAttention
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

SiteAttention SEO: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4314.25 ▼0.122.05 ▲0.4743.62 ▲2.26
Dashboard /wp-admin2,198 ▲185.59 ▲0.0190.83 ▲3.3384.08 ▲44.34
Posts /wp-admin/edit.php2,112 ▲92.11 ▲0.1635.28 ▼5.6335.81 ▲1.72
Add New Post /wp-admin/post-new.php1,541 ▲1323.11 ▲0.02653.21 ▼56.24125.27 ▲70.14
Media Library /wp-admin/upload.php1,415 ▲154.19 ▲0.0196.21 ▼3.6269.60 ▲23.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/siteattention/siteattention.php+341
    Undefined variable: response
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • SiteAttention
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/siteattention/admin/partials/siteattention-admin-display.php
    • > /wp-content/plugins/siteattention/public/partials/siteattention-public-display.php
    • > /wp-content/plugins/siteattention/tests/bootstrap.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant SITEATTENTION_API_URL - assumed 'SITEATTENTION_API_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/siteattention/includes/siteattention_seo_tool.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/siteattention/includes/class-siteattention.php:99
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/siteattention/siteattention.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/siteattention/tests/test-sample.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'SiteAttention_Admin' not found in wp-content/plugins/siteattention/admin/settings/class-siteattention-settings.php:9

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 93% 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:
  • Screenshots: These screenshots lack descriptions #5, #6, #7 in siteattention/assets to your readme.txt
The official readme.txt might help

siteattention/siteattention.php 92% from 13 tests

The principal PHP file in "SiteAttention SEO" v. 3.0.7 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected2,973 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71932541,277
PHP13260585867
CSS48737715
Sass211055
XML24226
PO File11022
JSON11011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity6.57
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods40
▷ Static methods25.00%
▷ Public methods3587.50%
▷ Protected methods00.00%
▷ Private methods512.50%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/logo-icon-20px.png1.52KB0.63KB▼ 58.75%
admin/images/logo.png21.20KB5.36KB▼ 74.74%
admin/images/logo-icon.png2.78KB2.58KB▼ 7.40%