# bbp-style-pack
Robin W's bbp-style-pack plugin with enhacements including multisite support.

## Key changes: ##

* bbP Topic Count Plugin Changes Applied
    * ALL changes covered in the Topic Count plugin video have been applied to Style Pack
        * https://github.com/codejp3/bbp-topic-count/tree/proposed-v3.0#readme
        * https://wp-multisite.local-dev.codejp3.com/temp-videos/bbp-topic-count-3-0.webm
    * ALL future changes/enhancements are now copy/paste between the 2 plugins so they're always BOTH up-to-date with minimal time/effort on your part.

#

* Multisite Compatibility
    * Each subsite generates its' own files using its' own settings, without conflicting with eachother or overwriting eachother. Partially Fixes:
        * https://wordpress.org/support/topic/last-update-broke-forum-styles/
    * Each subsite only enqueues THEIR generated files, not network-wide generated files for all subsites.
 
#
 
* Plugin Enhancements
    * New plugin_activation hook to handle tasks that only really need to be done when the plugin is activated (new activation, or updated)
        * Plugin versioning handled separately in plugin_activation hook.
            * Plugin version automatically populated from plugin WP header "Version: " meta value.
            * Removed obscure versioning code from plugins_loaded.
            * Removed reminder comment to update obscure versioning code from plugin header.
        * CSS/JS files automatically re-generated whenever the plugin is updated.
    * CSS code in /css/styles.php - removed capital letters and unnecessary spaces from properties/values to conform to CSS3 standards.
    * Minor code cleanup and removing old/obsolete code blocks and comments.

#

* Performance Tweaks
    * Only include files on the fronted and admin panel as needed instead of loading all files all the time.
    * CSS/JS files generated only as needed, instead of every page load (what was happening on multisites). Partially Fixes:
        * https://wordpress.org/support/topic/last-update-broke-forum-styles/
    * Generated files get a new version # every time they're generated. Tells browsers to load the newly generated file instead of using the browser cached version. Should help prevent support topics for "it's not working....oh wait, yeah it is, I just had to clear my browser cache" like:
        * https://wordpress.org/support/topic/close-forums-and-topics/#post-16404376
        * https://wordpress.org/support/topic/font-size-changes-not-working/#post-16123643
  
#

* Bug Fixes
    * Reply button missing closing div
        * https://wordpress.org/support/topic/reply-button-missing-closing-div/
    * Button classes bsp-one-half / bsp-one-third missing
        * https://wordpress.org/support/topic/classes-bsp-one-half-bsp-one-third-missing/
    * “Mark All Topics As Read” button alignment issue
        * https://wordpress.org/support/topic/classes-bsp-one-half-bsp-one-third-missing/#post-16288653
    * Forum Index Styling tab #15 "Hide Message" broken
        * https://wordpress.org/support/topic/close-forums-and-topics/#post-16399891
    * Dependencies declared for all enqueued files (prevents "Uncaught Referrence Errors"). Fixes:
        * https://wordpress.org/support/topic/uncaught-referenceerror-jquery-is-not-defined-38/
        * https://wordpress.org/support/topic/issue-with-loading-order-of-bsp-js-files/
    * No file is enqueued unless it exists (prevenets 404 errors). Fixes:
        * https://wordpress.org/support/topic/last-update-broke-forum-styles/#post-16317344 & many others too
    * Capitalized settings tab titles for consistency.
    * Removed unnecessary ending commas from single-line selectors in /css/styles.php to prevent "error parsing file" errors for generated CSS files.

#

* Translation Fixes
    * Translation .pot file regenerated
    * Translation .po & .mo files synced with new .pot for FR and RU translations.
    * Machine translation strings generated as fuzzy strings for any empty translation strings in FR and RU translations.
    * Japanese machine translation .po & .mo generated.
    * Fixed over 100 translation string issues. Every time I fixed the reported errors, new errors were found. Repeated the process until trnaslation generation processed without any errors. Here's a sample of the kind of issues reported and fixed for ONE batch.:
        * Warning: Found string without translatable content. (includes/settings_forums_index.php:80)
        * Warning: The string "The export file could not be found at <code>%s</code>. It is likely that this was caused by a permissions problem." contains placeholders but has no "translators:" comment to clarify their meaning. (includes/settings_import.php:64)
        * Warning: The string "This JSON file (version %s) is not supported by this version of the importer. Please update the plugin on the source, or download an older version of the plugin to this installation." contains placeholders but has no "translators:" comment to clarify their meaning. (includes/settings_import.php:101)
        * Warning: The string "Finally some phrases use format specifiers or placeholders for instance 'This forum has %1$s, %2$s, and was last updated %3$s by %4$s.' so may need some skill to amend." contains placeholders but has no "translators:" comment to clarify their meaning. (includes/settings_translation.php:31)
        * Warning: The string "%s topic" contains placeholders but has no "translators:" comment to clarify their meaning. (includes/widgets.php:687)
        * Warning: The string "%s Moderation: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:71)
        * Warning: Multiple placeholders should be ordered. (modtools/notifications.php:71)
        * Warning: The string "A new %s has been flagged for moderation: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:149)
        * Warning: Multiple placeholders should be ordered. (modtools/notifications.php:149)
        * Warning: The string "User: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:150)
        * Warning: The string "Topic: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:151)
        * Warning: The string "Content: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:152)
        * Warning: The string "A %s has been reported as %s: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:196)
        * Warning: Multiple placeholders should be ordered. (modtools/notifications.php:196)
        * Warning: The string "Reported by: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:201)
        * Warning: The string "Date: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:202)
        * Warning: The string "OP: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (modtools/notifications.php:203)
        * Warning: The string "Reply To: %s" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-reply.php:29)
        * Warning: The string "The topic &#8216;%s&#8217; is closed to new replies." contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-reply.php:185)
        * Warning: The string "The forum &#8216;%s&#8217; is closed to new topics and replies." contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-reply.php:193)
        * Warning: The string "Now Editing &ldquo;%s&rdquo;" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-topic.php:41)
        * Warning: The string "Create New Topic in &ldquo;%s&rdquo;" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-topic.php:43)
        * Warning: The string "Topic Title (Maximum Length: %d):" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform5/form-topic.php:77)
        * Warning: The string "Reply #%1$s in %2$s" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform6/form-reply.php:30)
        * Warning: The string "You may use these %s tags and attributes:" contains placeholders but has no "translators:" comment to clarify their meaning. (templates/topicandreplyform6/form-topic.php:103) 
