72% advanced-theme-search

Code Review | Advanced Theme Search

WordPress plugin Advanced Theme Search scored 72% from 54 tests.

About plugin

  • Plugin page: advanced-theme-se...
  • Plugin version: 0.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9
  • WordPress version: 5.9.2
  • First release: Nov 22, 2017
  • Latest release: Dec 5, 2017
  • Number of updates: 5
  • Update frequency: every 2.8 days
  • Top authors: klickonit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 593 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.07MB] [CPU: ▼331.19ms] Passed 4 tests

Server-side resources used by Advanced Theme Search
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1968.20 ▲12.11
Dashboard /wp-admin3.26 ▼0.1419.82 ▼15.16
Posts /wp-admin/edit.php3.26 ▼0.3820.92 ▼18.70
Add New Post /wp-admin/post-new.php3.26 ▼3.7122.22 ▼1,276.58
Media Library /wp-admin/upload.php3.26 ▼0.0420.25 ▼14.33
Advanced Theme Search /wp-admin/options-general.php?page=klick_ats3.2629.53

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 2 new options
New WordPress options
klick-ats-logging
klick-ats-advanced-search-toggle

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Theme Search
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,952 ▲19817.13 ▲1.239.30 ▲3.012.51 ▲0.06
Dashboard /wp-admin2,932 ▲456.45 ▼0.04132.87 ▼6.02156.57 ▼8.23
Posts /wp-admin/edit.php2,699 ▲53.57 ▲0.0161.50 ▲2.28141.23 ▼3.70
Add New Post /wp-admin/post-new.php1,672 ▼4522.27 ▲4.51430.93 ▲14.68159.70 ▲1.21
Media Library /wp-admin/upload.php1,706 ▲85.72 ▼0.01138.25 ▼4.76240.34 ▲47.58
Advanced Theme Search /wp-admin/options-general.php?page=klick_ats1,9212.8361.27153.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=klick_ats
    • > User notice in wp-includes/functions.php+5768
    add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
Please take a closer look at the following
  • 15× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/advanced-theme-search/templates/notices-templates/horizontal-notice.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-email-logger.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-logger.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-options.php
    • > /wp-content/plugins/advanced-theme-search/templates/notices-templates/main-dashboard-notices.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-php-logger.php
    • > /wp-content/plugins/advanced-theme-search/templates/klick-ats-tabs-header.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-notifier.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-abstract-logger.php
    • > /wp-content/plugins/advanced-theme-search/includes/class-klick-ats-db-operations.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-ats-manage.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-our-other-plugins.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-ats-manage-settings.php:11
    • > PHP Warning
      Use of undefined constant KLICK_ATS_PLUGIN_URL - assumed 'KLICK_ATS_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-our-other-plugins.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-themes-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-ats-manage.php on line 6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-themes-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-theme-search/templates/klick-ats-tab-ats-manage.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Advanced Theme Search enable/disable Tab), #2 (Download theme data to local DB), #3 (Do Advance search by selecting various parameters)
The official readme.txt might help

advanced-theme-search/advanced-theme-search.php 85% from 13 tests

Analyzing the main PHP file in "Advanced Theme Search" version 0.0.2
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 183 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected2,768 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
PHP214236231,395
CSS63316615
SVG10010475
JavaScript349119228
Markdown135055

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.08
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.46
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes215.38%
▷ Concrete classes1184.62%
▷ Final classes00.00%
Methods91
▷ Static methods66.59%
▷ Public methods9098.90%
▷ Protected methods00.00%
▷ Private methods11.10%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.14MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/notices/cs_sample_notice_icon.png20.74KB1.79KB▼ 91.39%
images/small_icon.png18.12KB0.45KB▼ 97.52%
images/notices/cs_sample_notice_icon2.png9.63KB4.69KB▼ 51.23%
images/ats-banner.png62.17KB21.45KB▼ 65.50%
images/notices/cs_sample_notice_icon3.png30.17KB6.04KB▼ 79.98%