67% ok-poster-group

Code Review | OK Poster Group

WordPress plugin OK Poster Group scored 67% from 54 tests.

About plugin

  • Plugin page: ok-poster-group
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.0
  • WordPress version: 6.3.1
  • First release: Mar 11, 2018
  • Latest release: Dec 7, 2018
  • Number of updates: 4
  • Update frequency: every 67.8 days
  • Top authors: svmidi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active / 2,480 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.93MB] [CPU: ▼33.45ms] Passed 4 tests

Server-side resources used by OK Poster Group
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.10 ▼3.25
Dashboard /wp-admin3.01 ▼0.2925.46 ▼23.05
Posts /wp-admin/edit.php3.01 ▼0.3422.28 ▼28.48
Add New Post /wp-admin/post-new.php3.01 ▼2.8727.91 ▼72.77
Media Library /wp-admin/upload.php3.01 ▼0.2123.65 ▼9.49
OKPosterGP /wp-admin/options-general.php?page=okposter-page3.0222.16

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 17 new options
New WordPress options
okposter_text_link
okposter_accesstoken
okposter_pubkey
okposter_posttype
widget_theysaidso_widget
okposter_counttext
okposter_gid
okposter_seckey
db_upgraded
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Checking browser requirements for OK Poster Group
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4713.23 ▼1.011.71 ▼0.3143.01 ▼7.39
Dashboard /wp-admin2,210 ▲224.78 ▼0.11135.95 ▲23.1046.20 ▲6.23
Posts /wp-admin/edit.php2,097 ▲52.01 ▲0.0139.49 ▼2.4636.71 ▲1.08
Add New Post /wp-admin/post-new.php6,471 ▲4,93720.45 ▼2.81892.23 ▲199.5051.52 ▲0.44
Media Library /wp-admin/upload.php1,389 ▲14.19 ▼0.0495.77 ▼16.1041.77 ▼4.84
OKPosterGP /wp-admin/options-general.php?page=okposter-page1,0522.0224.7431.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=okposter-page
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=okposter-page
    • > Notice in wp-content/plugins/ok-poster-group/inc/okp-core-class.php+347
    Undefined index: tab

SRP 50% 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 fix the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ok-poster-group/page/tab3-option1.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'OKPOSTERBASE' not found in wp-content/plugins/ok-poster-group/page/option1.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ok-poster-group/page/tab2-option1.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'OKPOSTERFUNCTION' not found in wp-content/plugins/ok-poster-group/page/tab1-option1.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/ok-poster-group/index-okp.php:11
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ok-poster-group/index-okp.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Requires php: Version not formatted correctly
  • Screenshots: A description for screenshot #6 is missing in ok-poster-group/assets to your readme.txt
You can look at the official readme.txt

ok-poster-group/index-okp.php 85% from 13 tests

This is the main PHP file of "OK Poster Group" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ok-poster-group.php" instead of "index-okp.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 190 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 detected583 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP7119111583

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity26.00
▷ Minimum class complexity13.00
▷ Maximum class complexity39.00
Average method complexity3.42
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods315.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants12
▷ Global constants18.33%
▷ Class constants1191.67%
▷ Public constants11100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.25MB with 0.17MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/opg-help-2.png117.86KB42.32KB▼ 64.10%
img/opg-help-0.png30.72KB10.94KB▼ 64.40%
img/opg-help-4.png52.98KB18.22KB▼ 65.60%
img/opg-help-3.png59.50KB20.38KB▼ 65.74%