63% wpachievements-free

Code Review | WPAchievements Free

WordPress plugin WPAchievements Free scored63%from 54 tests.

About plugin

  • Plugin page: wpachievements-free
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9
  • WordPress version: 6.3.1
  • First release: Aug 12, 2018
  • Latest release: Oct 27, 2018
  • Number of updates: 9
  • Update frequency: every 8.4 days
  • Top authors: NetReview.de (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,941 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
This plugin's installer ran successfully

Server metrics [RAM: ▲1.49MB] [CPU: ▲25.25ms] Passed 4 tests

This is a short check of server-side resources used by WPAchievements Free
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.51 ▲1.0548.50 ▲5.04
Dashboard /wp-admin4.99 ▲1.6984.55 ▲30.01
Posts /wp-admin/edit.php5.01 ▲1.6679.11 ▲28.32
Add New Post /wp-admin/post-new.php7.47 ▲1.59136.07 ▲37.62
Media Library /wp-admin/upload.php4.91 ▲1.6873.52 ▲38.74
WPAchievements /wp-admin/edit.php?post_type=wpachievements4.9673.65
FAQ /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_faq4.9183.23
Ranks /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_ranks4.9173.69
Reports /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_reports4.9773.24
Settings /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_settings4.9076.83

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 233 new files
Database: no new tables, 35 new options
New WordPress options
wpachievements_appID
widget_wpachievements_widget
wpachievements_popup_notifications
wpachievements_license_key
wpachievements_rank_type
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_wpachievements_quests_widget
wpachievements_ranks_data
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WPAchievements Free
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,236 ▲2,46513.95 ▼0.4314.43 ▲12.6744.44 ▼1.37
Dashboard /wp-admin4,475 ▲2,2875.08 ▲0.22105.92 ▲0.1691.88 ▲46.88
Posts /wp-admin/edit.php4,285 ▲2,1962.19 ▲0.1840.61 ▼0.8334.33 ▼2.54
Add New Post /wp-admin/post-new.php8,427 ▲6,89425.94 ▲2.63899.14 ▲186.0145.06 ▼6.72
Media Library /wp-admin/upload.php3,578 ▲2,1904.26 ▲0.0398.16 ▼13.3181.47 ▲33.25
WPAchievements /wp-admin/edit.php?post_type=wpachievements3,2492.1133.6033.45
FAQ /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_faq4,3691.9027.1156.29
Ranks /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_ranks3,3133.6860.1855.30
Reports /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_reports3,2163.7251.7971.29
Settings /wp-admin/edit.php?post_type=wpachievements&page=wpachievements_settings3,3442.0430.7531.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
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The uninstall procedure has failed, leaving 34 options in the database
    • db_upgraded
    • wpachievements_sim_ach
    • wpachievements_rank_status
    • wpachievements_ptim
    • can_compress_scripts
    • wpachievements_appID
    • widget_recent-posts
    • wpachievements_license_key
    • wpachievements_ach_page
    • widget_wpachievements_achievements_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpachievements-free/includes/widgets/widget_my_rank.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpachievements-free/includes/admin/stats-widgets/class-wpachievements-admin-widget-ranks.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpachievements_get_site_option() in wp-content/plugins/wpachievements-free/includes/social/facebook/setup.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpachievements-free/includes/widgets/widget_leaderboard.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wpachievements-free/includes/class-wpachievements-notification.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpachievements-free/wpachievements.php:163
    • > PHP Fatal error
      Uncaught Error: Class 'WPAchievements_Admin_Stats' not found in wp-content/plugins/wpachievements-free/includes/admin/stats-widgets/class-wpachievements-admin-widget-latest-achievements.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WPAchievements_Admin_Stats' not found in wp-content/plugins/wpachievements-free/includes/admin/stats-widgets/class-wpachievements-admin-widget-latest-quests.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wpachievements-free/includes/admin/stats-widgets/class-wpachievements-admin-widget-awarded-points.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wpachievements-free/includes/widgets/widget_my_quests.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #2, #3, #4, #5, #6, #7, #8, #9 in wpachievements-free/assets to your readme.txt
The official readme.txt might help

wpachievements-free/wpachievements.php 85% from 13 tests

This is the main PHP file of "WPAchievements Free" version 1.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpachievements-free.php" instead of "wpachievements.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wpachievements-free/includes/social/facebook/fb_ca_chain_bundle.crt
33,429 lines of code in 110 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript293,3277,63815,532
PHP501,8551,6979,245
CSS274742843,272
SVG30122,763
PO File19821,2972,617

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity22.66
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity4.98
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes00.00%
▷ Concrete classes38100.00%
▷ Final classes12.63%
Methods207
▷ Static methods13163.29%
▷ Public methods18689.86%
▷ Protected methods10.48%
▷ Private methods209.66%
Functions74
▷ Named functions74100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
90 PNG files occupy 0.38MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icons/thub_up_blue_stars_1.png3.65KB3.64KB0.13%
assets/img/locked.png6.62KB4.56KB▼ 31.06%
assets/img/forward_disabled.png1.33KB0.58KB▼ 56.42%
assets/img/prog_bar_back.png2.90KB0.21KB▼ 92.94%
assets/js/ui-darkness/css/ui-darkness/images/ui-bg_gloss-wave_25_333333_500x100.png3.73KB1.12KB▼ 69.92%