87% vacancy-personal-edition

Code Review | Vacancy Personal Edition

WordPress plugin Vacancy Personal Edition scored 87% from 54 tests.

About plugin

  • Plugin page: vacancy-personal-...
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-4.4.1
  • WordPress version: 5.8.1
  • First release: Dec 6, 2014
  • Latest release: Jan 14, 2016
  • Number of updates: 23
  • Update frequency: every 17.6 days
  • Top authors: a2rocklobster (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,795 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▼128.12ms] Passed 4 tests

This is a short check of server-side resources used by Vacancy Personal Edition
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▲0.5954.12 ▲16.78
Dashboard /wp-admin3.66 ▲0.6062.58 ▲12.76
Posts /wp-admin/edit.php3.77 ▲0.6658.21 ▲10.61
Add New Post /wp-admin/post-new.php6.02 ▲0.59113.40 ▼551.09
Media Library /wp-admin/upload.php3.60 ▲0.6051.86 ▲15.26
Calendar View /wp-admin/admin.php?page=va-admin-calendar3.6092.44
Locations /wp-admin/edit.php?post_type=va_location3.6446.42
Settings /wp-admin/admin.php?page=va-settings3.9047.39
Venues /wp-admin/edit.php?post_type=va_venue3.6456.10
Reservations /wp-admin/edit.php?post_type=va_reservation3.6450.34

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 56 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Vacancy Personal Edition
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,908 ▲32617.52 ▲1.5723.60 ▲13.9846.67 ▼3.55
Dashboard /wp-admin3,032 ▲986.84 ▲0.61145.24 ▼31.64107.93 ▲0.64
Posts /wp-admin/edit.php2,837 ▲983.07 ▲0.3572.56 ▲0.3296.64 ▲8.13
Add New Post /wp-admin/post-new.php1,731 ▲4819.12 ▲0.94409.61 ▼84.18125.95 ▲17.20
Media Library /wp-admin/upload.php1,766 ▼415.49 ▲0.45133.03 ▼44.4481.68 ▼37.29
Calendar View /wp-admin/admin.php?page=va-admin-calendar1,5842.7969.6981.59
Locations /wp-admin/edit.php?post_type=va_location1,5063.0170.6772.12
Settings /wp-admin/admin.php?page=va-settings2,5342.7172.8893.41
Venues /wp-admin/edit.php?post_type=va_venue1,5182.9480.8878.36
Reservations /wp-admin/edit.php?post_type=va_reservation1,6413.1066.2968.01

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

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 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/vacancy-personal-edition/va-reservation-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/vacancy-personal-edition/va-location-meta.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/vacancy-personal-edition/va-admin-calendar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/vacancy-personal-edition/va-venue-meta.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/vacancy-personal-edition/va-settings.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=va-admin-calendar
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse&ver=5.8.1 1:31592 "jQuery.Deferred exception: $(...).stickyTableHeaders is not a function" "TypeError: $(...).stickyTableHeaders is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=va-admin-calendar:315:14)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/admin.php?page=va-admin-calendar
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-mouse&ver=5.8.1 1:31702 Uncaught TypeError: $(...).stickyTableHeaders is not a function

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
The official readme.txt is a good inspiration

vacancy-personal-edition/vacancy.php 85% from 13 tests

"Vacancy Personal Edition" version 1.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("vacancy-personal-edition.php" instead of "vacancy.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin12,976 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript113311823,775
HTML36403,167
PHP61641493,029
PO File25706351,472
CSS86338802
SVG100399
Markdown3940207
JSON20073
CoffeeScript113652

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity403.00
▷ Minimum class complexity403.00
▷ Maximum class complexity403.00
Average method complexity10.14
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods44100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
7 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/chosen_v1.2.0/chosen-sprite.png0.53KB0.88KB0.00%
js/chosen_v1.2.0/docsupport/chosen.png1.47KB2.08KB0.00%
js/chosen_v1.2.0/docsupport/oss-credit.png4.30KB3.26KB▼ 24.02%
js/chosen_v1.2.0/chosen-sprite@2x.png0.72KB0.83KB0.00%
images/dark_leather.png72.69KB76.07KB0.00%