80% search-analytics

Code Review | WP Search Analytics

WordPress plugin WP Search Analytics scored80%from 54 tests.

About plugin

  • Plugin page: search-analytics
  • Plugin version: 1.4.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 2, 2018
  • Latest release: Sep 4, 2023
  • Number of updates: 42
  • Update frequency: every 48.0 days
  • Top authors: cornel.raiu (100%)

Code review

54 tests

User reviews

21 reviews

Install metrics

2,000+ active /20,824 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by WP Search Analytics
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0344.49 ▲8.05
Dashboard /wp-admin3.45 ▲0.1453.41 ▲4.52
Posts /wp-admin/edit.php3.50 ▲0.1451.26 ▲2.10
Add New Post /wp-admin/post-new.php5.96 ▲0.0888.44 ▼12.00
Media Library /wp-admin/upload.php3.31 ▲0.0839.95 ▲4.85
MWT: Search Analytics /wp-admin/options-general.php?page=search-analytics3.2729.56
Search Analytics /wp-admin/index.php?page=search-analytics/admin/includes/class.stats.php3.2935.76

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 274 new files
Database: 2 new tables, 7 new options
New tables
wp_mwt_search_terms
wp_mwt_search_history
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
mwtsa_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by WP Search Analytics
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7114.21 ▼0.351.87 ▲0.1643.06 ▲2.29
Dashboard /wp-admin2,232 ▲545.64 ▼0.0695.24 ▼5.9942.65 ▼0.48
Posts /wp-admin/edit.php2,110 ▲102.02 ▲0.0235.14 ▼2.4336.42 ▼5.81
Add New Post /wp-admin/post-new.php1,534 ▼1623.15 ▲4.99682.84 ▲5.3947.65 ▼32.25
Media Library /wp-admin/upload.php1,407 ▲44.18 ▼0.0294.04 ▼8.5145.96 ▲0.82
MWT: Search Analytics /wp-admin/options-general.php?page=search-analytics1,2612.0022.8442.50
Search Analytics /wp-admin/index.php?page=search-analytics/admin/includes/class.stats.php1,2923.02101.2838.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_mwt_search_history
    • wp_mwt_search_terms
  • The uninstall procedure has failed, leaving 7 options in the database
    • mwtsa_db_version
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 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)
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: history, statistics, analytics, search

search-analytics/mwt-search-analytics.php 92% from 13 tests

The principal PHP file in "WP Search Analytics" v. 1.4.8 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("search-analytics.php" instead of "mwt-search-analytics.php")

Code Analysis Passed 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
No dangerous file extensions were detected2,503 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP19613522,320
JavaScript32214133
CSS126050

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity18.82
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes15.88%
Methods118
▷ Static methods2823.73%
▷ Public methods11496.61%
▷ Protected methods10.85%
▷ Private methods32.54%
Functions11
▷ Named functions981.82%
▷ Anonymous functions218.18%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
249 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/flags/sx.png0.50KB0.59KB0.00%
admin/assets/images/flags/pg.png0.55KB0.64KB0.00%
admin/assets/images/flags/gr.png0.32KB0.37KB0.00%
admin/assets/images/flags/ls.png0.35KB0.39KB0.00%
admin/assets/images/flags/hr.png0.44KB0.48KB0.00%