PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 2.38
Strong Testimonials v2.38
3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / includes / scripts.php
strong-testimonials / includes Last commit date
integrations 7 years ago class-strong-form.php 7 years ago class-strong-log.php 7 years ago class-strong-mail.php 7 years ago class-strong-templates.php 7 years ago class-strong-testimonials-order.php 7 years ago class-strong-testimonials-privacy.php 7 years ago class-strong-testimonials-render.php 7 years ago class-strong-testimonials-shortcode-average.php 7 years ago class-strong-testimonials-shortcode-count.php 7 years ago class-strong-testimonials-shortcode.php 7 years ago class-strong-view-display.php 7 years ago class-strong-view-form.php 7 years ago class-strong-view-slideshow.php 7 years ago class-strong-view.php 7 years ago class-walker-strong-category-checklist-front.php 7 years ago deprecated.php 7 years ago filters.php 7 years ago functions-activation.php 7 years ago functions-content.php 7 years ago functions-image.php 7 years ago functions-rating.php 7 years ago functions-template-form.php 7 years ago functions-template.php 7 years ago functions-views.php 7 years ago functions.php 7 years ago l10n-polylang.php 7 years ago l10n-wpml.php 7 years ago post-types.php 7 years ago retro.php 7 years ago scripts.php 7 years ago widget2.php 7 years ago
scripts.php
234 lines
1 <?php
2 /**
3 * Register scripts and styles.
4 */
5
6 function wpmtst_scripts() {
7
8 $plugin_version = get_option( 'wpmtst_plugin_version' );
9 $options = get_option( 'wpmtst_options' );
10 $compat_options = get_option( 'wpmtst_compat_options' );
11
12 $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
13
14 /**
15 * Page controller
16 *
17 * @since 2.28.0
18 */
19 wp_register_script( 'wpmtst-controller',
20 WPMTST_PUBLIC_URL . "js/controller{$min}.js",
21 array( 'jquery' ),
22 $plugin_version,
23 true );
24
25 /**
26 * Key : Description
27 * -----------------------------------------------------------------
28 * (blank) : No Pjax support
29 * universal : Universal (timer)
30 * observer : Target nodes added + timer
31 * event : Event emitter
32 * - Pjax by MoOx @link https://github.com/MoOx/pjax
33 * script : Specific script
34 * - Barba @link http://barbajs.org/index.html
35 *
36 * Remember: array top level is converted to strings!
37 */
38 $ajax = $compat_options['ajax'];
39 $controller = $compat_options['controller'];
40
41 //TODO Use defaults + array_merge instead
42 $parms = array(
43 'initializeOn' => isset( $controller['initialize_on'] ) ? $controller['initialize_on'] : '',
44 'method' => isset( $ajax['method'] ) ? $ajax['method'] : '',
45 'universalTimer' => isset( $ajax['universal_timer'] ) ? $ajax['universal_timer'] * 1000 : 0,
46 'observerTimer' => isset( $ajax['observer_timer'] ) ? $ajax['observer_timer'] * 1000 : 0,
47 'event' => isset( $ajax['event'] ) ? $ajax['event'] : '',
48 'script' => isset( $ajax['script'] ) ? $ajax['script'] : '',
49 'containerId' => isset( $ajax['container_id'] ) ? $ajax['container_id'] : '',
50 'addedNodeId' => isset( $ajax['addednode_id'] ) ? $ajax['addednode_id'] : '',
51 'debug' => defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG && apply_filters( 'debug_strong_controller', true ),
52 );
53 wp_localize_script( 'wpmtst-controller', 'strongControllerParms', $parms );
54
55 /**
56 * Fonts
57 */
58 wp_register_style( 'wpmtst-font-awesome',
59 WPMTST_PUBLIC_URL . 'fonts/font-awesome-4.6.3/css/font-awesome.min.css',
60 array(),
61 '4.6.3' );
62
63 /**
64 * Simple pagination
65 */
66 wp_register_script( 'wpmtst-pager',
67 WPMTST_PUBLIC_URL . "js/lib/strongpager/jquery.strongpager{$min}.js",
68 array( 'jquery', 'imagesloaded' ),
69 false,
70 true );
71
72 /**
73 * imagesLoaded, if less than WordPress 4.6
74 */
75 if ( ! wp_script_is( 'imagesloaded', 'registered' ) ) {
76 wp_register_script( 'imagesloaded',
77 WPMTST_PUBLIC_URL . 'js/lib/imagesloaded/imagesloaded.pkgd.min.js',
78 array(),
79 '3.2.0',
80 true );
81 }
82
83 /**
84 * Masonry
85 */
86 wp_register_style( 'wpmtst-masonry-style',
87 WPMTST_PUBLIC_URL . 'css/masonry.css',
88 array(),
89 $plugin_version );
90
91 /**
92 * Columns
93 */
94 wp_register_style( 'wpmtst-columns-style',
95 WPMTST_PUBLIC_URL . 'css/columns.css',
96 array(),
97 $plugin_version );
98
99 /**
100 * Grid
101 */
102 wp_register_style( 'wpmtst-grid-style',
103 WPMTST_PUBLIC_URL . 'css/grid.css',
104 array(),
105 $plugin_version );
106
107 /**
108 * Ratings
109 */
110 $deps = array();
111 if ( isset( $options['load_font_awesome'] ) && $options['load_font_awesome'] ) {
112 $deps = array( 'wpmtst-font-awesome' );
113 }
114
115 wp_register_style( 'wpmtst-rating-form',
116 WPMTST_PUBLIC_URL . 'css/rating-form.css',
117 $deps,
118 $plugin_version );
119
120 wp_register_style( 'wpmtst-rating-display',
121 WPMTST_PUBLIC_URL . 'css/rating-display.css',
122 $deps,
123 $plugin_version );
124
125 /**
126 * Form handling
127 */
128 wp_register_script( 'wpmtst-validation-plugin',
129 WPMTST_PUBLIC_URL . "js/lib/validate/jquery.validate{$min}.js",
130 array( 'jquery' ),
131 '1.16.0',
132 true );
133
134 wp_register_script( 'wpmtst-form-validation',
135 WPMTST_PUBLIC_URL . "js/lib/form-validation/form-validation{$min}.js",
136 array( 'wpmtst-validation-plugin', 'jquery-form' ),
137 $plugin_version,
138 true );
139
140 /**
141 * Localize jQuery Validate plugin.
142 *
143 * @since 1.16.0
144 */
145 $locale = get_locale();
146 if ( 'en_US' != $locale ) {
147
148 $lang_parts = explode( '_', $locale );
149
150 $lang_files = array(
151 'messages_' . $locale . '.min.js',
152 'messages_' . $lang_parts[0] . '.min.js',
153 );
154
155 foreach ( $lang_files as $file ) {
156 $path = WPMTST_PUBLIC . 'js/lib/validate/localization/' . $file;
157 $url = WPMTST_PUBLIC_URL . 'js/lib/validate/localization/' . $file;
158 if ( file_exists( $path ) ) {
159 wp_register_script( 'wpmtst-validation-lang', $url, array( 'wpmtst-validation-plugin' ), false, true );
160 break;
161 }
162 }
163
164 }
165
166 /**
167 * Slider
168 */
169 wp_register_script( 'jquery-actual',
170 WPMTST_PUBLIC_URL . "js/lib/actual/jquery.actual{$min}.js",
171 array( 'jquery' ),
172 '1.0.16',
173 true );
174
175 wp_register_script( 'verge',
176 WPMTST_PUBLIC_URL . "js/lib/verge/verge{$min}.js",
177 array(),
178 '1.10.2',
179 true );
180
181 wp_register_script( 'wpmtst-slider',
182 WPMTST_PUBLIC_URL . "js/lib/strongslider/jquery.strongslider{$min}.js",
183 array( 'jquery-actual', 'imagesloaded', 'underscore', 'verge' ),
184 $plugin_version,
185 true );
186
187 /**
188 * Read more in place
189 */
190 wp_register_script( 'wpmtst-readmore',
191 WPMTST_PUBLIC_URL . "js/lib/readmore/readmore{$min}.js",
192 array(),
193 $plugin_version,
194 true );
195
196 wp_register_style( 'wpmtst-animate',
197 WPMTST_PUBLIC_URL . 'css/animate.min.css',
198 array(),
199 '' );
200
201 }
202 add_action( 'wp_enqueue_scripts', 'wpmtst_scripts' );
203
204 /**
205 * @param $tag
206 * @param $handle
207 *
208 * @return mixed
209 */
210 function wpmtst_defer_scripts( $tag, $handle ) {
211 $scripts_to_defer = array(
212 // pagination
213 'wpmtst-pager',
214 // form
215 'wpmtst-validation-plugin',
216 'wpmtst-validation-lang',
217 'wpmtst-form-validation',
218 // slider
219 'jquery-actual',
220 'verge',
221 'wpmtst-slider',
222 'wpmtst-readmore',
223 'jquery-masonry',
224 'wpmtst-admin-views-script',
225 );
226
227 if ( in_array( $handle, $scripts_to_defer ) ) {
228 return str_replace( ' src', ' defer src', $tag );
229 }
230
231 return $tag;
232 }
233 add_filter( 'script_loader_tag', 'wpmtst_defer_scripts', 10, 2 );
234