diff --git a/dummy-data/anaglyph-lite_dummy_data.xml b/dummy-data/anaglyph-lite_dummy_data.xml new file mode 100644 index 0000000..953d0f8 --- /dev/null +++ b/dummy-data/anaglyph-lite_dummy_data.xml @@ -0,0 +1,9801 @@ + + + + + + + + + + + + + + + + + + + + + + + Anaglyph Lite + https://fruitfulthemes.wpengine.com/anaglyph-lite + Free WordPress responsive theme + Thu, 07 Sep 2017 16:38:19 +0000 + en-US + 1.2 + http://fruitfulthemes.wpengine.com/ + https://fruitfulthemes.wpengine.com/anaglyph-lite + + 1 + + + 6 + + + + + + 7 + + + + + + 8 + + + + + + 9 + + + + + + 10 + + + + + + 11 + + + + + + 12 + + + + + + 13 + + + + + + 14 + + + + + + 15 + + + + + + 16 + + + + + + 17 + + + + + + 18 + + + + + + 19 + + + + + + 20 + + + + + + 21 + + + + + + 22 + + + + + + 23 + + + + + + + 24 + + + + + + 25 + + + + + + 26 + + + + + + 27 + + + + + + 28 + + + + + + 29 + + + + + + 30 + + + + + + 31 + + + + + + 32 + + + + + + 33 + + + + + + + 34 + + + + + + + 35 + + + + + + 36 + + + + + + 37 + + + + + + 38 + + + + + + 39 + + + + + + 40 + + + + + + + 41 + + + + + + 42 + + + + + + + 43 + + + + + + 44 + + + + + + 45 + + + + + + 46 + + + + + + 47 + + + + + + 48 + + + + + + 49 + + + + + + 50 + + + + + + 51 + + + + + + 52 + + + + + + 53 + + + + + + + 1 + + + + + + 54 + + + + + + + 55 + + + + + + 56 + + + + + + 57 + + + + + + 58 + + + + + + 59 + + + + + + 60 + + + + + + 61 + + + + + + 62 + + + + + + 63 + + + + + + + 64 + + + + + + + 65 + + + + + + + 66 + + + + + + + 67 + + + + + + + 68 + + + + + + 69 + + + + + + + 70 + + + + + 71 + + + + + + 72 + + + + + 73 + + + + + + 74 + + + + + 75 + + + + + 76 + + + + + 77 + + + + + 78 + + + + + 79 + + + + + 80 + + + + + 81 + + + + + 82 + + + + + 83 + + + + + 84 + + + + + 85 + + + + + 86 + + + + + 87 + + + + + 88 + + + + + 89 + + + + + 90 + + + + + 91 + + + + + + 92 + + + + + 93 + + + + + 94 + + + + + 95 + + + + + 96 + + + + + 97 + + + + + 98 + + + + + + 99 + + + + + 100 + + + + + 101 + + + + + 102 + + + + + 103 + + + + + 104 + + + + + 105 + + + + + 106 + + + + + + 107 + + + + + 108 + + + + + 109 + + + + + 110 + + + + + 111 + + + + + 112 + + + + + 113 + + + + + 114 + + + + + 115 + + + + + 116 + + + + + 117 + + + + + 118 + + + + + 119 + + + + + 120 + + + + + 121 + + + + + 122 + + + + + 123 + + + + + 124 + + + + + 125 + + + + + + 126 + + + + + 127 + + + + + 128 + + + + + 129 + + + + + 130 + + + + + 131 + + + + + 132 + + + + + + 133 + + + + + + 134 + + + + + + 135 + + + + + 136 + + + + + 137 + + + + + 138 + + + + + 139 + + + + + 140 + + + + + 141 + + + + + 142 + + + + + 143 + + + + + 144 + + + + + 145 + + + + + 146 + + + + + 147 + + + + + 148 + + + + + 149 + + + + + 150 + + + + + 151 + + + + + 152 + + + + + 153 + + + + + 154 + + + + + 155 + + + + + 156 + + + + + 157 + + + + + 158 + + + + + 159 + + + + + 160 + + + + + 161 + + + + + + 162 + + + + + + 163 + + + + + 164 + + + + + 165 + + + + + 166 + + + + + 167 + + + + + 168 + + + + + 169 + + + + + + 170 + + + + + 171 + + + + + 172 + + + + + 173 + + + + + 174 + + + + + 175 + + + + + 176 + + + + + 177 + + + + + 178 + + + + + 179 + + + + + 180 + + + + + 181 + + + + + 182 + + + + + 183 + + + + + + 184 + + + + + 185 + + + + + 186 + + + + + 187 + + + + + + 188 + + + + + 189 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 200nav_menu + + + https://wordpress.org/?v=4.8.1 + + + T_1_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo/t_1_front/ + Fri, 07 Jun 2013 10:35:28 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_1_front.jpg + + + + 16 + + + + + + + 15 + 0 + + + 0 + + + + + + + + + + + + T_1_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo/t_1_back/ + Fri, 07 Jun 2013 10:35:39 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_1_back.jpg + + + + 17 + + + + + + + 15 + 0 + + + 0 + + + + + + + + + + + + T_2_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality/t_2_front/ + Fri, 07 Jun 2013 10:41:23 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_2_front.jpg + + + + 20 + + + + + + + 19 + 0 + + + 0 + + + + + + + + + + + + T_2_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality/t_2_back/ + Fri, 07 Jun 2013 10:41:34 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_2_back.jpg + + + + 21 + + + + + + + 19 + 0 + + + 0 + + + + + + + + + + + + T_4_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/t_4_front/ + Fri, 07 Jun 2013 10:45:14 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_4_front.jpg + + + + 25 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + T_3_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/t_3_back/ + Fri, 07 Jun 2013 10:45:26 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_3_back.jpg + + + + 26 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + T_3_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/t_3_front/ + Fri, 07 Jun 2013 10:45:27 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_3_front.jpg + + + + 27 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + T_4_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/t_4_back/ + Fri, 07 Jun 2013 10:45:29 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_4_back.jpg + + + + 28 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + T_4_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/t_4_front-2/ + Fri, 07 Jun 2013 10:45:30 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_4_front1.jpg + + + + 29 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + T_5_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette/t_5_front/ + Fri, 07 Jun 2013 10:49:13 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_5_front.jpg + + + + 32 + + + + + + + 31 + 0 + + + 0 + + + + + + + + + + + + T_5_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette/t_5_back/ + Fri, 07 Jun 2013 10:49:23 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_5_back.jpg + + + + 33 + + + + + + + 31 + 0 + + + 0 + + + + + + + + + + + + T_6_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja/t_6_front/ + Fri, 07 Jun 2013 10:51:51 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_6_front.jpg + + + + 35 + + + + + + + 34 + 0 + + + 0 + + + + + + + + + + + + T_6_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja/t_6_back/ + Fri, 07 Jun 2013 10:52:02 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_6_back.jpg + + + + 36 + + + + + + + 34 + 0 + + + 0 + + + + + + + + + + + + T_7_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja/t_7_front/ + Fri, 07 Jun 2013 10:52:55 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_7_front.jpg + + + + 38 + + + + + + + 37 + 0 + + + 0 + + + + + + + + + + + + T_7_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja/t_7_back/ + Fri, 07 Jun 2013 10:53:29 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/T_7_back.jpg + + + + 39 + + + + + + + 37 + 0 + + + 0 + + + + + + + + + + + + hoodie_7_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/hoodie_7_front/ + Fri, 07 Jun 2013 10:59:40 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_7_front.jpg + + + + 43 + + + + + + + 40 + 0 + + + 0 + + + + + + + + + + + + hoodie_7_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/hoodie_7_back/ + Fri, 07 Jun 2013 10:59:54 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_7_back.jpg + + + + 44 + + + + + + + 40 + 0 + + + 0 + + + + + + + + + + + + hoodie_1_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/hoodie_1_back/ + Fri, 07 Jun 2013 11:00:00 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_1_back.jpg + + + + 45 + + + + + + + 40 + 0 + + + 0 + + + + + + + + + + + + hoodie_1_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/hoodie_1_front/ + Fri, 07 Jun 2013 11:00:01 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_1_front.jpg + + + + 46 + + + + + + + 40 + 0 + + + 0 + + + + + + + + + + + + St. Louis Blues + https://fruitfulthemes.wpengine.com/anaglyph-lite/originaldixielandjazzbandwithalbernard-stlouisblues/ + Thu, 05 Jul 2012 16:49:29 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2012/07/originaldixielandjazzbandwithalbernard-stlouisblues.mp3 + + + + 821 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + hoodie_2_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-2/hoodie_2_front/ + Fri, 07 Jun 2013 11:01:23 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_2_front.jpg + + + + 48 + + + + + + + 47 + 0 + + + 0 + + + + + + + + + + + + hoodie_2_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-2/hoodie_2_back/ + Fri, 07 Jun 2013 11:02:26 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_2_back.jpg + + + + 49 + + + + + + + 47 + 0 + + + 0 + + + + + + + + + + + + hoodie_3_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/patient-ninja/hoodie_3_front/ + Fri, 07 Jun 2013 11:03:16 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_3_front.jpg + + + + 51 + + + + + + + 50 + 0 + + + 0 + + + + + + + + + + + + hoodie_3_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/patient-ninja/hoodie_3_back/ + Fri, 07 Jun 2013 11:03:50 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_3_back.jpg + + + + 52 + + + + + + + 50 + 0 + + + 0 + + + + + + + + + + + + hoodie_4_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja-2/hoodie_4_front/ + Fri, 07 Jun 2013 11:05:03 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_4_front.jpg + + + + 54 + + + + + + + 53 + 0 + + + 0 + + + + + + + + + + + + hoodie_4_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja-2/hoodie_4_back/ + Fri, 07 Jun 2013 11:05:13 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_4_back.jpg + + + + 55 + + + + + + + 53 + 0 + + + 0 + + + + + + + + + + + + hoodie_5_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette-2/hoodie_5_front/ + Fri, 07 Jun 2013 11:06:32 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_5_front.jpg + + + + 57 + + + + + + + 56 + 0 + + + 0 + + + + + + + + + + + + hoodie_5_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette-2/hoodie_5_back/ + Fri, 07 Jun 2013 11:07:10 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_5_back.jpg + + + + 58 + + + + + + + 56 + 0 + + + 0 + + + + + + + + + + + + hoodie_6_front + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-2/hoodie_6_front/ + Fri, 07 Jun 2013 11:12:02 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_6_front.jpg + + + + 61 + + + + + + + 60 + 0 + + + 0 + + + + + + + + + + + + hoodie_6_back + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-2/hoodie_6_back/ + Fri, 07 Jun 2013 11:12:16 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/hoodie_6_back.jpg + + + + 62 + + + + + + + 60 + 0 + + + 0 + + + + + + + + + + + + poster_1_up + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-3/poster_1_up/ + Fri, 07 Jun 2013 11:21:34 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/poster_1_up.jpg + + + + 68 + + + + + + + 67 + 0 + + + 0 + + + + + + + + + + + + Poster_1_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-3/poster_1_flat/ + Fri, 07 Jun 2013 11:22:05 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/Poster_1_flat.jpg + + + + 69 + + + + + + + 67 + 0 + + + 0 + + + + + + + + + + + + poster_2_up + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/flying-ninja/poster_2_up/ + Fri, 07 Jun 2013 11:24:19 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/poster_2_up.jpg + + + + 71 + + + + + + + 70 + 0 + + + 0 + + + + + + + + + + + + Poster_2_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/flying-ninja/poster_2_flat/ + Fri, 07 Jun 2013 11:24:47 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/Poster_2_flat.jpg + + + + 72 + + + + + + + 70 + 0 + + + 0 + + + + + + + + + + + + poster_3_up + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality-2/poster_3_up/ + Fri, 07 Jun 2013 11:26:47 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/poster_3_up.jpg + + + + 74 + + + + + + + 73 + 0 + + + 0 + + + + + + + + + + + + Poster_3_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality-2/poster_3_flat/ + Fri, 07 Jun 2013 11:27:31 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/Poster_3_flat.jpg + + + + 75 + + + + + + + 73 + 0 + + + 0 + + + + + + + + + + + + poster_4_up + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-3/poster_4_up/ + Fri, 07 Jun 2013 11:28:07 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/poster_4_up.jpg + + + + 77 + + + + + + + 76 + 0 + + + 0 + + + + + + + + + + + + Poster_4_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-3/poster_4_flat/ + Fri, 07 Jun 2013 11:28:20 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/Poster_4_flat.jpg + + + + 78 + + + + + + + 76 + 0 + + + 0 + + + + + + + + + + + + poster_5_up + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-3/poster_5_up/ + Fri, 07 Jun 2013 11:29:26 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/poster_5_up.jpg + + + + 80 + + + + + + + 79 + 0 + + + 0 + + + + + + + + + + + + Poster_5_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-3/poster_5_flat/ + Fri, 07 Jun 2013 11:29:37 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/Poster_5_flat.jpg + + + + 81 + + + + + + + 79 + 0 + + + 0 + + + + + + + + + + + + cd_1_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-1/cd_1_angle/ + Fri, 07 Jun 2013 11:32:44 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_1_angle.jpg + + + + 84 + + + + + + + 83 + 0 + + + 0 + + + + + + + + + + + + cd_1_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-1/cd_1_flat/ + Fri, 07 Jun 2013 11:32:57 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_1_flat.jpg + + + + 85 + + + + + + + 83 + 0 + + + 0 + + + + + + + + + + + + cd_2_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-2/cd_2_angle/ + Fri, 07 Jun 2013 11:33:53 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_2_angle.jpg + + + + 88 + + + + + + + 87 + 0 + + + 0 + + + + + + + + + + + + cd_2_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-2/cd_2_flat/ + Fri, 07 Jun 2013 11:34:07 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_2_flat.jpg + + + + 89 + + + + + + + 87 + 0 + + + 0 + + + + + + + + + + + + cd_3_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-3/cd_3_angle/ + Fri, 07 Jun 2013 11:34:58 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_3_angle.jpg + + + + 91 + + + + + + + 90 + 0 + + + 0 + + + + + + + + + + + + cd_3_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-3/cd_3_flat/ + Fri, 07 Jun 2013 11:35:10 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_3_flat.jpg + + + + 92 + + + + + + + 90 + 0 + + + 0 + + + + + + + + + + + + cd_4_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-1/cd_4_flat/ + Fri, 07 Jun 2013 11:36:10 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_4_flat.jpg + + + + 94 + + + + + + + 93 + 0 + + + 0 + + + + + + + + + + + + cd_4_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-1/cd_4_angle/ + Fri, 07 Jun 2013 11:36:22 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_4_angle.jpg + + + + 95 + + + + + + + 93 + 0 + + + 0 + + + + + + + + + + + + cd_5_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-4/cd_5_angle/ + Fri, 07 Jun 2013 11:37:04 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_5_angle.jpg + + + + 97 + + + + + + + 96 + 0 + + + 0 + + + + + + + + + + + + cd_5_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-4/cd_5_flat/ + Fri, 07 Jun 2013 11:37:17 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_5_flat.jpg + + + + 98 + + + + + + + 96 + 0 + + + 0 + + + + + + + + + + + + cd_6_angle + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-2/cd_6_angle/ + Fri, 07 Jun 2013 11:37:51 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_6_angle.jpg + + + + 100 + + + + + + + 99 + 0 + + + 0 + + + + + + + + + + + + cd_6_flat + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-2/cd_6_flat/ + Fri, 07 Jun 2013 11:38:03 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/06/cd_6_flat.jpg + + + + 101 + + + + + + + 99 + 0 + + + 0 + + + + + + + + + + + + mt-sample-background + https://fruitfulthemes.wpengine.com/anaglyph-lite/mt-sample-background/ + Fri, 24 Jul 2015 09:57:25 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/07/mt-sample-background.jpg + + + + 823 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + 2014-slider-mobile-behavior + https://fruitfulthemes.wpengine.com/anaglyph-lite/2014-slider-mobile-behavior/ + Wed, 04 Dec 2013 18:08:29 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2013/12/2014-slider-mobile-behavior.mov + + + + 1690 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + slide-1 + https://fruitfulthemes.wpengine.com/anaglyph-lite/slide-1/ + Wed, 23 Sep 2015 07:39:54 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/09/slide-1.jpg + + + + 1708 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + slide-2 + https://fruitfulthemes.wpengine.com/anaglyph-lite/slide-2/ + Wed, 23 Sep 2015 07:39:55 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/09/slide-2.jpg + + + + 1709 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + portfolio-detail-01-1024x449 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/top-10-trends-in-web-design-for-2014/portfolio-detail-01-1024x449/ + Fri, 04 Dec 2015 10:33:25 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/portfolio-detail-01-1024x449.jpg + + + + 1879 + + + + + + + 1877 + 0 + + + 0 + + + + + + + + + + + + blog-06 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/whats-more-important-copy-or-design/blog-06/ + Fri, 04 Dec 2015 10:37:37 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/blog-06.jpg + + + + 1882 + + + + + + + 1881 + 0 + + + 0 + + + + + + + + + + + + blog-03 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/friday-inspiration-round/blog-03/ + Fri, 04 Dec 2015 10:39:39 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/blog-03.jpg + + + + 1885 + + + + + + + 1884 + 0 + + + 0 + + + + + + + + + + + + bg-grain-1024x357 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/friday-inspiration-round/bg-grain-1024x357/ + Fri, 04 Dec 2015 10:40:19 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/bg-grain-1024x357.jpg + + + + 1886 + + + + + + + 1884 + 0 + + + 0 + + + + + + + + + + + + Blog + https://fruitfulthemes.wpengine.com/anaglyph-lite/blog/ + Sat, 21 May 2011 01:51:43 +0000 + + https://wpthemetestdata.wordpress.com/?page_id=703 + + + + 703 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + Home + https://fruitfulthemes.wpengine.com/anaglyph-lite/ + Wed, 23 Sep 2015 07:45:07 +0000 + + https://anaglyph-lite.fruitfulcode.com/?page_id=1710 + + + + 1710 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1781/ + Fri, 04 Dec 2015 09:32:31 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1781 + + + + 1781 + + + + + + + 0 + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Documentation + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/documentation/ + Fri, 04 Dec 2015 09:32:31 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1782 + + + + 1782 + + + + + + + 0 + 9 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Support + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/support/ + Fri, 04 Dec 2015 09:32:31 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1783 + + + + 1783 + + + + + + + 0 + 10 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1785/ + Fri, 04 Dec 2015 09:33:04 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1785 + + + + 1785 + + + + + + + 0 + 2 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1786/ + Fri, 04 Dec 2015 09:33:05 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1786 + + + + 1786 + + + + + + + 0 + 3 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Product + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/product/ + Fri, 04 Dec 2015 09:36:52 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1787 + + + + 1787 + + + + + + + 0 + 4 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1788/ + Fri, 04 Dec 2015 09:37:05 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1788 + + + + 1788 + + + + + + + 0 + 8 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1789/ + Fri, 04 Dec 2015 09:37:05 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1789 + + + + 1789 + + + + + + + 0 + 7 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1807/ + Fri, 04 Dec 2015 09:46:35 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1807 + + + + 1807 + + + + + + + 0 + 6 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Product variable + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/1809/ + Fri, 04 Dec 2015 09:47:32 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1809 + + + + 1809 + + + + + + + 0 + 5 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + blog-02 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/good-and-great-typography/blog-02/ + Fri, 04 Dec 2015 10:42:26 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/blog-02.jpg + + + + 1889 + + + + + + + 1888 + 0 + + + 0 + + + + + + + + + + + + blog-041 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/whats-next-after-flat-design/blog-041/ + Fri, 04 Dec 2015 10:47:27 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/blog-041.jpg + + + + 1893 + + + + + + + 1892 + 0 + + + 0 + + + + + + + + + + + + blog-05 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/10-awesome-photoshop-actions-package/blog-05/ + Fri, 04 Dec 2015 10:49:07 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/blog-05.jpg + + + + 1896 + + + + + + + 1895 + 0 + + + 0 + + + + + + + + + + + + title-background + https://fruitfulthemes.wpengine.com/anaglyph-lite/title-background/ + Fri, 04 Dec 2015 11:06:07 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/title-background.jpg + + + + 1898 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + bg-office-02 + https://fruitfulthemes.wpengine.com/anaglyph-lite/bg-office-02/ + Fri, 04 Dec 2015 11:10:28 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/bg-office-02.jpg + + + + 1899 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + bg-town + https://fruitfulthemes.wpengine.com/anaglyph-lite/bg-town/ + Fri, 04 Dec 2015 11:10:32 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/bg-town.jpg + + + + 1900 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + bg-grain + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/friday-inspiration-round/bg-grain/ + Fri, 04 Dec 2015 11:23:18 +0000 + + https://anaglyph-lite.fruitfulcode.com/wp-content/uploads/sites/19/2015/12/bg-grain.jpg + + + + 1902 + + + + + + + 1884 + 0 + + + 0 + + + + + + + + + + + + mt-sample-background + https://fruitfulthemes.wpengine.com/anaglyph-lite/mt-sample-background-2/ + Mon, 13 Jun 2016 11:49:42 +0000 + + https://fruitfulthemes.wpengine.com/anaglyph-lite/wp-content/uploads/sites/19/2016/06/mt-sample-background.jpg + + + + 1915 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + Draft + https://fruitfulthemes.wpengine.com/anaglyph-lite/?p=1164 + Tue, 09 Apr 2013 18:20:39 +0000 + + http://wptest.io/demo/?p=922 + + + + 1164 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + Shop + https://fruitfulthemes.wpengine.com/anaglyph-lite/shop/ + Wed, 23 Sep 2015 08:00:43 +0000 + + https://anaglyph-lite.fruitfulcode.com/shop/ + + + + 1723 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + Cart + https://fruitfulthemes.wpengine.com/anaglyph-lite/cart/ + Wed, 23 Sep 2015 08:00:43 +0000 + + https://anaglyph-lite.fruitfulcode.com/cart/ + + + + 1724 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + Checkout + https://fruitfulthemes.wpengine.com/anaglyph-lite/checkout/ + Wed, 23 Sep 2015 08:00:43 +0000 + + https://anaglyph-lite.fruitfulcode.com/checkout/ + + + + 1725 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + My Account + https://fruitfulthemes.wpengine.com/anaglyph-lite/my-account/ + Wed, 23 Sep 2015 08:00:43 +0000 + + https://anaglyph-lite.fruitfulcode.com/my-account/ + + + + 1726 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + Post Format: Audio + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-audio-2/ + Fri, 04 Dec 2015 09:59:36 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1852 + + St. Louis Blues + +[audio mp3="https://anaglyph-multipage.fruitfulcode.com/wp-content/uploads/sites/2/2014/05/originaldixielandjazzbandwithalbernard-stlouisblues.mp3"][/audio]]]> + + 1852 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Post Format: Chat + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-chat-2/ + Fri, 04 Dec 2015 10:00:46 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1854 + + + + 1854 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Template: Comments + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/template-comments-2/ + Fri, 04 Dec 2015 10:01:25 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1856 + + +
  • Threaded comments up to 10 levels deep
  • +
  • Paginated comments (set Settings > Discussion > Break comments into pages to 5 top level comments per page)
  • +
  • Comment markup / formatting
  • +
  • Comment images
  • +
  • Comment videos
  • +
  • Author comments
  • +
  • Gravatars and default fallbacks
  • +]]>
    + + 1856 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + 2 + + + http://example.org/ + + + + + + + 0 + 0 + + + + + + + 3 + + + http://example.org/ + + + + + + + 2 + 0 + + + + + + + 4 + + + http://example.org/ + + + + + + + 0 + 0 + + + + + + + 5 + + + http://example.org/ + + + + + + + 0 + 0 + + + + + + + 6 + + + http://example.org/ + + + + + + + 5 + 0 + + + + + + + 7 + + + http://example.org/ + + + + + + + 6 + 0 + + + + + + + 8 + + + http://example.org/ + + + + + + + 7 + 0 + + + + + + + 9 + + + http://example.org/ + + + + + + + 8 + 0 + + + + + + + 10 + + + http://example.org/ + + + + + + + 9 + 0 + + + + + +
    + + Template: Password Protected (the password is "enter") + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/template-password-protected-the-password-is-enter/ + Fri, 04 Dec 2015 10:16:11 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1858 + + This content, comments, pingbacks, and trackbacks should not be visible until the password is entered.]]> + + 1858 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + Media: Twitter Embeds + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/media-twitter-embeds-2/ + Fri, 04 Dec 2015 10:18:04 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1861 + + Twitter Embeds feature.]]> + + 1861 + + + + + + + 0 + 0 + + + 0 + + + + + + + +

    Really cool to read through and find so much awesomeness added to WordPress 3.6 while I was gone. I should take three weeks off more often.

    — Andrew Nacin (@nacin) April 3, 2013]]>
    +
    + + + + + + + + + + + + +
    + + Markup: Text Alignment + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/markup-text-alignment-2/ + Fri, 04 Dec 2015 10:19:11 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1863 + + Default +This is a paragraph. It should not have any alignment of any kind. It should just flow like you would normally expect. Nothing fancy. Just straight up text, free flowing, with love. Completely neutral and not picking a side or sitting on the fence. It just is. It just freaking is. It likes where it is. It does not feel compelled to pick a side. Leave him be. It will just be better that way. Trust me. +

    Left Align

    +

    This is a paragraph. It is left aligned. Because of this, it is a bit more liberal in it's views. It's favorite color is green. Left align tends to be more eco-friendly, but it provides no concrete evidence that it really is. Even though it likes share the wealth evenly, it leaves the equal distribution up to justified alignment.

    + +

    Center Align

    +

    This is a paragraph. It is center aligned. Center is, but nature, a fence sitter. A flip flopper. It has a difficult time making up its mind. It wants to pick a side. Really, it does. It has the best intentions, but it tends to complicate matters more than help. The best you can do is try to win it over and hope for the best. I hear center align does take bribes.

    + +

    Right Align

    +

    This is a paragraph. It is right aligned. It is a bit more conservative in it's views. It's prefers to not be told what to do or how to do it. Right align totally owns a slew of guns and loves to head to the range for some practice. Which is cool and all. I mean, it's a pretty good shot from at least four or five football fields away. Dead on. So boss.

    + +

    Justify Align

    +

    This is a paragraph. It is justify aligned. It gets really mad when people associate it with Justin Timberlake. Typically, justified is pretty straight laced. It likes everything to be in it's place and not all cattywampus like the rest of the aligns. I am not saying that makes it better than the rest of the aligns, but it does tend to put off more of an elitist attitude.

    ]]>
    + + 1863 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + +
    + + Post Format: Quote + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-quote-2/ + Fri, 04 Dec 2015 10:20:39 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1865 + + Only one thing is impossible for God: To find any sense in any copyright law on the planet. +Mark Twain]]> + + 1865 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Markup: Image alignment + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/markup-image-alignment-2/ + Fri, 04 Dec 2015 10:22:12 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1867 + + None, Left, Right, and Center. In addition, they also get the options of Thumbnail, Medium, Large & Fullsize. +

    Image Alignment 580x300

    +The image above happens to be centered. + +Image Alignment 150x150The rest of this paragraph is filler for the sake of seeing the text wrap around the 150x150 image, which is left aligned. + +As you can see the should be some space above, below, and to the right of the image. The text should not be creeping on the image. Creeping is just not right. Images need breathing room too. Let them speak like you words. Let them do their jobs without any hassle from the text. In about one more sentence here, we'll see that the text moves from the right of the image down below the image in seamless transition. Again, letting the do it's thang. Mission accomplished! + +And now for a massively large image. It also has no alignment. + +Image Alignment 1200x400 + +The image above, though 1200px wide, should not overflow the content area. It should remain contained with no visible disruption to the flow of content. + +Image Alignment 300x200 + +And now we're going to shift things to the right align. Again, there should be plenty of room above, below, and to the left of the image. Just look at him there... Hey guy! Way to rock that right side. I don't care what the left aligned image says, you look great. Don't let anyone else tell you differently. + +In just a bit here, you should see the text start to wrap below the right aligned image and settle in nicely. There should still be plenty of room and everything should be sitting pretty. Yeah... Just like that. It never felt so good to be right. + +And just when you thought we were done, we're going to do them all over again with captions! + +[caption id="attachment_906" align="aligncenter" width="580"]Image Alignment 580x300 Look at 580x300 getting some caption love.[/caption] + +The image above happens to be centered. The caption also has a link in it, just to see if it does anything funky. + +[caption id="attachment_904" align="alignleft" width="150"]Image Alignment 150x150 Itty-bitty caption.[/caption] + +The rest of this paragraph is filler for the sake of seeing the text wrap around the 150x150 image, which is left aligned. + +As you can see the should be some space above, below, and to the right of the image. The text should not be creeping on the image. Creeping is just not right. Images need breathing room too. Let them speak like you words. Let them do their jobs without any hassle from the text. In about one more sentence here, we'll see that the text moves from the right of the image down below the image in seamless transition. Again, letting the do it's thang. Mission accomplished! + +And now for a massively large image. It also has no alignment. + +[caption id="attachment_907" align="alignnone" width="1200"]Image Alignment 1200x400 Massive image comment for your eyeballs.[/caption] + +The image above, though 1200px wide, should not overflow the content area. It should remain contained with no visible disruption to the flow of content. + +[caption id="attachment_905" align="alignright" width="300"]Image Alignment 300x200 Feels good to be right all the time.[/caption] + +And now we're going to shift things to the right align. Again, there should be plenty of room above, below, and to the left of the image. Just look at him there... Hey guy! Way to rock that right side. I don't care what the left aligned image says, you look great. Don't let anyone else tell you differently. + +In just a bit here, you should see the text start to wrap below the right aligned image and settle in nicely. There should still be plenty of room and everything should be sitting pretty. Yeah... Just like that. It never felt so good to be right. + +And that's a wrap, yo! You survived the tumultuous waters of alignment. Image alignment achievement unlocked!]]>
    + + 1867 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + +
    + + POST FORMAT: VIDEO + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-video/ + Fri, 04 Dec 2015 10:23:14 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1869 + + Eddy's Start An Uproar! EP. + +Learn more about WordPress Embeds.]]> + + 1869 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + Post Format: Gallery + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-gallery-2/ + Fri, 04 Dec 2015 10:23:57 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1871 + + + + 1871 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Post format: image (with caption) + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-image-with-caption/ + Fri, 04 Dec 2015 10:25:13 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1873 + + It’s dangerous to go alone! Take this.[/caption]]]> + + 1873 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 11 + + + + + + + + + + 0 + 0 + + + + Post Format: Image + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/post-format-image-2/ + Fri, 04 Dec 2015 10:26:32 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1875 + + + +I really love this wallpaper. It makes me think fondly of Jane]]> + + 1875 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test + https://fruitfulthemes.wpengine.com/anaglyph-lite/test/ + Thu, 21 Jan 2016 10:35:00 +0000 + + https://anaglyph-lite.fruitfulcode.com/?page_id=1907 + + ]]> + + 1907 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + Anaglyph lite + https://fruitfulthemes.wpengine.com/anaglyph-lite/anaglyph-lite/ + Fri, 25 Mar 2016 12:46:56 +0000 + + https://anaglyph-lite.fruitfulcode.com/?page_id=1912 + + + + 1912 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + WE CREATE AWESOMENESS + https://fruitfulthemes.wpengine.com/anaglyph-lite/we-create-awesomeness/ + Fri, 25 Mar 2016 12:47:31 +0000 + + https://anaglyph-lite.fruitfulcode.com/?page_id=1914 + + + + 1914 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + Woo Logo + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo/ + Fri, 07 Jun 2013 10:35:51 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=15 + + + + 15 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 14 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Premium Quality + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality/ + Fri, 07 Jun 2013 10:41:52 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=19 + + + + 19 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 15 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 16 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + Ship Your Idea + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/ + Fri, 07 Jun 2013 10:46:01 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=22 + + + + 22 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 17 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 18 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 19 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 20 + + + + + + + wttgeycvakrq, [url=http://gafdpplusfyo.com/]gafdpplusfyo[/url], [link=http://ddimuztqssno.com/]ddimuztqssno[/link], http://jefthzxydngv.com/]]> + + + 0 + 0 + + + + + + + + Ninja Silhouette + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette/ + Fri, 07 Jun 2013 10:49:51 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=31 + + + + 31 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 21 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja/ + Fri, 07 Jun 2013 10:52:06 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=34 + + + + 34 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Happy Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja/ + Fri, 07 Jun 2013 10:53:15 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=37 + + + + 37 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 22 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 23 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ship Your Idea + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/ + Fri, 07 Jun 2013 11:00:28 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=40 + + + + 40 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 24 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 25 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 26 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-2/ + Fri, 07 Jun 2013 11:02:31 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=47 + + + + 47 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 27 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 28 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Patient Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/patient-ninja/ + Fri, 07 Jun 2013 11:03:56 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=50 + + + + 50 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 29 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 30 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 31 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + Happy Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/happy-ninja-2/ + Fri, 07 Jun 2013 11:05:37 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=53 + + + + 53 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 32 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 33 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ninja Silhouette + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ninja-silhouette-2/ + Fri, 07 Jun 2013 11:07:19 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=56 + + + + 56 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 34 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 35 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 36 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 37 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 38 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 39 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + Woo Logo + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-2/ + Fri, 07 Jun 2013 11:12:55 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=60 + + + + 60 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 40 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 41 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Ship Your Idea + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-3/ + Fri, 07 Jun 2013 11:22:50 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=67 + + + + 67 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + https://fruitfulthemes.wpengine.com/anaglyph-lite/?post_type=product&p=1750 + Mon, 30 Nov -0001 00:00:00 +0000 + + https://anaglyph-lite.fruitfulcode.com/?post_type=product&p=1750 + + + + 1750 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + Top 10 Trends In Web Design for 2014 + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/top-10-trends-in-web-design-for-2014/ + Fri, 04 Dec 2015 10:34:23 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1877 + + + + 1877 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 12 + + + http://example.org/ + + + + + + + 0 + 0 + + + + + + + 13 + + + http://example.org/ + + + + + + + 0 + 0 + + + + + + + + What's more Important? Copy or Design + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/whats-more-important-copy-or-design/ + Fri, 04 Dec 2015 10:37:47 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1881 + + + + 1881 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + Friday Inspiration Round + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/friday-inspiration-round/ + Fri, 04 Dec 2015 10:40:38 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1884 + + + + 1884 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Good and Great Typography + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/good-and-great-typography/ + Fri, 04 Dec 2015 10:43:45 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1888 + + + + 1888 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + What's Next After Flat Design? + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/whats-next-after-flat-design/ + Fri, 04 Dec 2015 10:47:34 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1892 + + + + 1892 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10 Awesome Photoshop Actions Package + https://fruitfulthemes.wpengine.com/anaglyph-lite/2015/12/04/10-awesome-photoshop-actions-package/ + Fri, 04 Dec 2015 10:49:59 +0000 + + https://anaglyph-lite.fruitfulcode.com/?p=1895 + + + + 1895 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 47 + + + + + + + + + + 0 + 0 + + + + + + + 48 + + + + + + + + + + 0 + 0 + + + + + + + 49 + + + + + + + + + + 0 + 0 + + + + + + + 50 + + + + + + + + + + 0 + 0 + + + + + + + 51 + + + + + + + + + + 0 + 0 + + + + + + + 52 + + + + + + + + + + 47 + 0 + + + + Ship Your Idea - Black + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/?attribute_pa_color=black + Fri, 07 Jun 2013 10:44:57 +0000 + + https://demo.woothemes.com/woocommerce/?product_variation=product-22-variation + + + + 23 + + + + + + + 22 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ship Your Idea - Green + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea/?attribute_pa_color=green + Fri, 07 Jun 2013 10:44:58 +0000 + + https://demo.woothemes.com/woocommerce/?product_variation=product-22-variation-2 + + + + 24 + + + + + + + 22 + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ship Your Idea - Black + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/?attribute_pa_color=black + Fri, 07 Jun 2013 10:59:15 +0000 + + https://demo.woothemes.com/woocommerce/?product_variation=product-40-variation + + + + 41 + + + + + + + 40 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ship Your Idea - Blue + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/ship-your-idea-2/?attribute_pa_color=blue + Fri, 07 Jun 2013 10:59:15 +0000 + + https://demo.woothemes.com/woocommerce/?product_variation=product-40-variation-2 + + + + 42 + + + + + + + 40 + 1 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flying Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/flying-ninja/ + Fri, 07 Jun 2013 11:25:01 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=70 + + + + 70 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 42 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 43 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 44 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 45 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + 46 + + + + + + + ffvjsvbqqxrs, [url=http://obiyhlgvegzk.com/]obiyhlgvegzk[/url], [link=http://lzusgaajklha.com/]lzusgaajklha[/link], http://yxnmwlvcdjbo.com/]]> + + + 0 + 0 + + + + + + + + Premium Quality + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/premium-quality-2/ + Fri, 07 Jun 2013 11:27:38 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=73 + + + + 73 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 53 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 54 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + Woo Ninja + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-ninja-3/ + Fri, 07 Jun 2013 11:28:45 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=76 + + + + 76 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 55 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Logo + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-logo-3/ + Fri, 07 Jun 2013 11:29:44 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=79 + + + + 79 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Woo Album #1 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-1/ + Fri, 07 Jun 2013 11:33:05 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=83 + + + + 83 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Woo Album #2 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-2/ + Fri, 07 Jun 2013 11:34:14 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=87 + + + + 87 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 56 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Album #3 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-3/ + Fri, 07 Jun 2013 11:35:18 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=90 + + + + 90 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 57 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Single #1 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-1/ + Fri, 07 Jun 2013 11:36:34 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=93 + + + + 93 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Woo Album #4 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-album-4/ + Fri, 07 Jun 2013 11:37:23 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=96 + + + + 96 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 58 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 59 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + + Woo Single #2 + https://fruitfulthemes.wpengine.com/anaglyph-lite/product/woo-single-2/ + Fri, 07 Jun 2013 11:38:12 +0000 + + https://demo.woothemes.com/woocommerce/?post_type=product&p=99 + + + + 99 + + + + + + + 0 + 0 + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 60 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + + 61 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + + + +
    +
    diff --git a/dummy-data/anaglyph-lite_options.json b/dummy-data/anaglyph-lite_options.json new file mode 100644 index 0000000..c062c4b --- /dev/null +++ b/dummy-data/anaglyph-lite_options.json @@ -0,0 +1 @@ +{"last_tab":"","logo":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/images\/logo.png","id":"","height":"","width":"","thumbnail":""},"logo-retina":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/images\/logo@2x.png","id":"","height":"","width":"","thumbnail":""},"logo-dimensions":{"width":"129","height":"18"},"favicon":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/favicon\/favicon-16x16.png","id":"","height":"","width":"","thumbnail":""},"favicon-iphone":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/favicon\/favicon-57x57.png","id":"","height":"","width":"","thumbnail":""},"favicon-iphone-retina":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/favicon\/favicon-114x114.png","id":"","height":"","width":"","thumbnail":""},"favicon-ipad":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/favicon\/favicon-72x72.png","id":"","height":"","width":"","thumbnail":""},"favicon-ipad-retina":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/admin\/anaglyph-options\/patterns\/favicon\/favicon-144x144.png","id":"","height":"","width":"","thumbnail":""},"smoothscroll":"1","excerpt":"2","pp-comments":"post","pp-breadcrumbs":"0","pp-blog":"1","pp-post":"3","pp-columns":"2","pp-animations":"bottom","pp-date":"1","pp-num-comments":"1","pp-thumbnail":"0","pp-thumbnail-single":"","pp-tags":"1","pp-authors":"1","pp-share":"1","pp-animation-mobile":"1","body-background":{"background-color":"#ffffff","background-repeat":"inherit","background-size":"inherit","background-attachment":"inherit","background-position":"","background-image":"","media":{"id":"","height":"","width":"","thumbnail":""}},"headline-before-sep-color":"#face00","headline-after-sep-color":"#E23A00","top-title-text":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"48px","color":"#ffffff"},"top-title-bg-color":{"color":"#000000","alpha":"0.8","rgba":"rgba(0,0,0,0.8)"},"blog-date-text":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","font-size":"14px","color":"#ffffff"},"blog-date-bg-color":"#292422","navigation-text":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","font-size":"14px"},"navigation-border":{"border-top":"2px","border-right":"2px","border-bottom":"2px","border-left":"2px","border-style":"solid","border-color":"solid"},"navigation-border-color":{"regular":"#999999","hover":"#000000","active":"#E23A00"},"navigation-link-color":{"regular":"#292422","hover":"#292422","active":"#ffffff"},"navigation-bglink-color":{"regular":"#ffffff","hover":"#ffffff","active":"#E23A00"},"switch-slider":"1","home-slides":["1912","1914"],"slider-links":"0","slider-parallax":"0","slider-showspeed":"8000","slider-animationeffect-in":"flipInX","slider-animationeffect-out":"fadeOutUp","slider-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"72px","color":"#fff"},"slider-sub-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"36px","color":"#fff"},"slider-title-bg-color":{"color":"#000000","alpha":"0.9","rgba":"rgba(0,0,0,0.9)"},"header-background-color":"#FFFFFF","header-fixed-settings":"1","header-spacing":{"padding-top":"10px","padding-bottom":"10px","units":"px"},"menu-font-settings":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"14px"},"menu-link-color":{"regular":"#292422","hover":"#292422","active":"#292422"},"submenu-link-color":{"regular":"#292422","hover":"#E23A00","active":"#E23A00"},"submenu-itembg-color":{"regular":"#EDEAE6","hover":"#FFFFFF","active":"#FFFFFF"},"submenu-color":"#EDEAE6","submenu-itemborder-color":{"color":"#000000","alpha":"0.05","rgba":"rgba(0,0,0,0.05)"},"before-item-color":"#E23A00","after-item-color":"#face00","general-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","font-size":"14px","color":"#333"},"p-opacity":"0.5","hone-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"72px","color":"#333"},"htwo-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"36px","color":"#333"},"hthree-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"none","font-size":"24px","color":"#333"},"hfour-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"700","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"18px","color":"#333"},"hfive-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"14px","color":"#333"},"hsix-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-transform":"uppercase","font-size":"14px","color":"#333"},"p-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","text-align":"inherit","font-size":"14px","line-height":"24px","color":"#292422"},"content-link-color":{"regular":"#292422","hover":"#e23a00","active":"#e23a00"},"facebook-url":"https:\/\/facebook.com\/fruitfulc0de","twitter-url":"https:\/\/twitter.com\/fruitfulcode","linkedin-url":"","myspace-url":"","gplus-url":"","dribbble-url":"http:\/\/dribbble.com\/fruitfulcode","flickr-url":"","youtube-url":"","delicious-url":"","deviantart-url":"","rss-url":"","instagram-url":"","pinterest-url":"","vimeo-url":"","picassa-url":"","tumblr-url":"","email-address":"","skype-username":"","contact-stitle":"Contact us","contact-satitle":"Questions or just wanna say hello? We\u2019re waiting!","contact-scolor":"#181818","contact-simage":{"url":"","id":"","height":"","width":"","thumbnail":""},"contact-address-icon-color":"#E23A00","contact-sopacity":"opacity-5","contact-information":"1","contact-location":"YOUR COMPANY","contact-address":"4815 Kinney Street\r\nSpringfield, MA 01103","contact-tel":"413-474-5551","contact-fax":"","contact-skype":"fruitfulcode","contact-add-email":"","contact-section-cform":"-1","contact-email":"mail@fruitfulcode.com","contact-description":"Worried about a SPAM? We are first to hate it!","contact-submit":"Send a message","contact-form-fields":{"enabled":{"placebo":"placebo","name":"Name","email":"Email","message":"Message"},"disabled":{"placebo":"placebo","mob":"Mobile","phone":"Phone","captcha":"Captcha"}},"contact-animations":"1","simple-post":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"simple-page":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"search-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"404-titleimage":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"404-image":{"url":"","id":"","height":"","width":"","thumbnail":""},"404-text":"It looks like nothing was found at this location. Maybe try a search?","category-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"archive-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"author-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"tag-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"footer-text":"\u00a9 Fruitful Code<\/a>, Powered by WordPress<\/a>","footer-color":"#181818","footer-image":{"url":"","id":"","height":"","width":"","thumbnail":""},"opacity-fsection":"opacity-3","footer-issocial":"1","footer-iscontact":"1","footer-typography":{"font-family":"Montserrat","font-options":"","google":"1","font-weight":"400","font-style":"","subsets":"latin","font-size":"14px","color":"#fff"},"custom-css":"","custom-js":"","shopheader-image":{"url":"https:\/\/anaglyph-lite.fruitfulcode.com\/wp-content\/themes\/anaglyph-lite\/includes\/theme\/assets\/bgs\/title-background.jpg","id":"","height":"","width":"","thumbnail":""},"shop-layout":"2","shop-product-perpage":"12","shop-product-perrow":"4","shop-animations":"bottom","redux-backup":"1"} \ No newline at end of file diff --git a/front-page.php b/front-page.php index e7079cb..5827ab1 100644 --- a/front-page.php +++ b/front-page.php @@ -58,13 +58,13 @@
    @@ -72,8 +72,8 @@
    '; } ?> diff --git a/functions.php b/functions.php index dab01d5..91e00e6 100644 --- a/functions.php +++ b/functions.php @@ -46,4 +46,13 @@ locate_template('/includes/theme/theme-woocommerce.php', true); } -locate_template('/includes/theme/theme-inlinestyles.php', true); \ No newline at end of file +locate_template('/includes/theme/theme-inlinestyles.php', true); + + +if (is_admin()) { + // Fruitful statistics + require get_template_directory() . '/vendor/fruitful-stats/send-statistics.php'; + + $FF_anaglyph_lite_Stats = new FF_anaglyph_lite_Stats( __FILE__ ); + $FF_anaglyph_lite_Stats->dispatch(); +} diff --git a/includes/admin/anaglyph-options/admin-config.php b/includes/admin/anaglyph-options/admin-config.php index 0541b4c..982df0c 100644 --- a/includes/admin/anaglyph-options/admin-config.php +++ b/includes/admin/anaglyph-options/admin-config.php @@ -1,2028 +1,2133 @@ initSettings(); - } else { - add_action('plugins_loaded', array($this, 'initSettings'), 10); - } - - } - +if ( ! class_exists( 'anaglyph_config' ) ) { + + class anaglyph_config { + + public $args = array(); + public $sections = array(); + public $theme; + public $ReduxFramework; + + public function __construct() { + if ( ! class_exists( 'ReduxFramework' ) ) { + return; + } + if ( true == redux_Helpers::isTheme( __FILE__ ) ) { + $this->initSettings(); + } else { + add_action( 'plugins_loaded', array( $this, 'initSettings' ), 10 ); + } + + } + function disable_redux_notice() { echo ''; } - - public function initSettings() { - add_action('admin_head', array($this,'disable_redux_notice')); - $this->theme = wp_get_theme(); + + public function initSettings() { + add_action( 'admin_head', array( $this, 'disable_redux_notice' ) ); + $this->theme = wp_get_theme(); $this->setArguments(); - $this->setHelpTabs(); - $this->setSections(); - if (!isset($this->args['opt_name'])) return; - add_action( 'anaglyph/loaded', array( $this, 'remove_demo' ) ); - - $this->ReduxFramework = new ReduxFramework($this->sections, $this->args); - } + $this->setHelpTabs(); + $this->setSections(); + if ( ! isset( $this->args['opt_name'] ) ) { + return; + } + add_action( 'anaglyph/loaded', array( $this, 'remove_demo' ) ); - /** + $this->ReduxFramework = new ReduxFramework( $this->sections, $this->args ); + } - This is a test function that will let you see when the compiler hook occurs. - It only runs if a field set with compiler=>true is changed. + /** + * + * This is a test function that will let you see when the compiler hook occurs. + * It only runs if a field set with compiler=>true is changed. + * */ + function compiler_action( $options, $css ) { + } - * */ - function compiler_action($options, $css) {} + /** + * + * Custom function for filtering the sections array. Good for child themes to override or add to the sections. + * Simply include this function in the child themes functions.php file. + * + * NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme, + * so you must use get_template_directory_uri() if you want to use any of the built in icons + * */ + function dynamic_section( $sections ) { + //$sections = array(); + $sections[] = array( + 'title' => __( 'Section via hook', 'anaglyph-lite' ), + 'desc' => __( '

    This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.

    ', 'anaglyph-lite' ), + 'icon' => 'el-icon-paper-clip', + 'fields' => array() + ); - /** + return $sections; + } - Custom function for filtering the sections array. Good for child themes to override or add to the sections. - Simply include this function in the child themes functions.php file. + /** + * + * Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions. + * */ + function change_arguments( $args ) { + //$args['dev_mode'] = true; + return $args; + } - NOTE: the defined constants for URLs, and directories will NOT be available at this point in a child theme, - so you must use get_template_directory_uri() if you want to use any of the built in icons + // Remove the demo link and the notice of integrated demo from the Redux-framework plugin + function remove_demo() { + // Used to hide the demo mode link from the plugin page. Only used when Anaglyph is a plugin. + if ( class_exists( 'ReduxFrameworkPlugin' ) ) { + remove_filter( 'plugin_row_meta', array( + ReduxFrameworkPlugin::instance(), + 'plugin_metalinks' + ), null, 2 ); - * */ - function dynamic_section($sections) { - //$sections = array(); - $sections[] = array( - 'title' => __('Section via hook', 'anaglyph-lite'), - 'desc' => __('

    This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.

    ', 'anaglyph-lite'), - 'icon' => 'el-icon-paper-clip', - 'fields' => array() - ); + // Used to hide the activation notice informing users of the demo panel. Only used when Anaglyph is a plugin. + remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) ); + } + } - return $sections; - } - /** + public function setSections() { + // Background Patterns Reader + $sample_patterns_url = get_template_directory_uri() . '/includes/admin/anaglyph-options/patterns/'; - Filter hook for filtering the args. Good for child themes to override or add to the args array. Can also be used in other functions. + ob_start(); - * */ - function change_arguments($args) { - //$args['dev_mode'] = true; - return $args; - } + $item_name = $this->theme->get( 'Name' ); + $tags = $this->theme->Tags; + $screenshot = $this->theme->get_screenshot(); + $class = $screenshot ? 'has-screenshot' : ''; - // Remove the demo link and the notice of integrated demo from the Redux-framework plugin - function remove_demo() { - // Used to hide the demo mode link from the plugin page. Only used when Anaglyph is a plugin. - if ( class_exists( 'ReduxFrameworkPlugin' ) ) { - remove_filter( 'plugin_row_meta', array( - ReduxFrameworkPlugin::instance(), - 'plugin_metalinks' - ), null, 2 ); - // Used to hide the activation notice informing users of the demo panel. Only used when Anaglyph is a plugin. - remove_action( 'admin_notices', array( ReduxFrameworkPlugin::instance(), 'admin_notices' ) ); - } - } - - - public function setSections() { - // Background Patterns Reader - $sample_patterns_url = get_template_directory_uri() . '/includes/admin/anaglyph-options/patterns/'; - - ob_start(); - - $item_name = $this->theme->get('Name'); - $tags = $this->theme->Tags; - $screenshot = $this->theme->get_screenshot(); - $class = $screenshot ? 'has-screenshot' : ''; - - - - $customize_title = sprintf(__('Customize “%s”', 'anaglyph-lite'), $this->theme->display('Name')); - - ?> -
    - - - - <?php esc_attr_e('Current theme preview', 'anaglyph-lite'); ?> + $customize_title = sprintf( __( 'Customize “%s”', 'anaglyph-lite' ), $this->theme->display( 'Name' ) ); + + ?> +
    + + + + <?php esc_attr_e( 'Current theme preview', 'anaglyph-lite' ); ?> - - <?php esc_attr_e('Current theme preview', 'anaglyph-lite'); ?> - + + <?php esc_attr_e( 'Current theme preview', 'anaglyph-lite' ); ?> + -

    theme->display('Name'); ?>

    +

    theme->display( 'Name' ); ?>

      -
    • theme->display('Author')); ?>
    • -
    • theme->display('Version')); ?>
    • -
    • ' . __('Tags', 'anaglyph-lite') . ': '; ?>theme->display('Tags')); ?>
    • +
    • theme->display( 'Author' ) ); ?>
    • +
    • theme->display( 'Version' ) ); ?>
    • +
    • ' . __( 'Tags', 'anaglyph-lite' ) . ': '; ?>theme->display( 'Tags' ) ); ?>
    -

    theme->display('Description'); ?>

    - theme->parent()) { - printf('

    ' . __('This child theme requires its parent theme, %2$s.', 'anaglyph-lite') . '

    ', __('http://codex.wordpress.org/Child_Themes', 'anaglyph-lite'), $this->theme->parent()->display('Name')); - } - ?> +

    theme->display( 'Description' ); ?>

    + theme->parent() ) { + printf( '

    ' . __( 'This child theme requires its parent theme, %2$s.', 'anaglyph-lite' ) . '

    ', __( 'http://codex.wordpress.org/Child_Themes', 'anaglyph-lite' ), $this->theme->parent()->display( 'Name' ) ); + } + ?>
    - get_contents(dirname(__FILE__) . '/info-html.html'); - } - - $arr_section = array(); + get_contents( dirname( __FILE__ ) . '/info-html.html' ); + } + + $arr_section = array(); $arr_slider_effects = array( - "bounce"=>'bounce', - "flash"=>'flash', - "pulse"=>'pulse', - "rubberBand"=>'rubberBand', - "shake"=>'shake', - "swing"=>'swing', - "tada"=>'tada', - "wobble"=>'wobble', - "bounceIn"=>'bounceIn', - "bounceInDown"=>'bounceInDown', - "bounceInLeft"=>'bounceInLeft', - "bounceInRight"=>'bounceInRight', - "bounceInUp"=>'bounceInUp', - "bounceOut"=>'bounceOut', - "bounceOutDown"=>'bounceOutDown', - "bounceOutLeft"=>'bounceOutLeft', - "bounceOutRight"=>'bounceOutRight', - "bounceOutUp"=>'bounceOutUp', - "fadeIn"=>'fadeIn', - "fadeInDown"=>'fadeInDown', - "fadeInDownBig"=>'fadeInDownBig', - "fadeInLeft"=>'fadeInLeft', - "fadeInLeftBig"=>'fadeInLeftBig', - "fadeInRight"=>'fadeInRight', - "fadeInRightBig"=>'fadeInRightBig', - "fadeInUp"=>'fadeInUp', - "fadeInUpBig"=>'fadeInUpBig', - "fadeOut"=>'fadeOut', - "fadeOutDown"=>'fadeOutDown', - "fadeOutDownBig"=>'fadeOutDownBig', - "fadeOutLeft"=>'fadeOutLeft', - "fadeOutLeftBig"=>'fadeOutLeftBig', - "fadeOutRight"=>'fadeOutRight', - "fadeOutRightBig"=>'fadeOutRightBig', - "fadeOutUp"=>'fadeOutUp', - "fadeOutUpBig"=>'fadeOutUpBig', - "flip"=>'flip', - "flipInX"=>'flipInX', - "flipInY"=>'flipInY', - "flipOutX"=>'flipOutX', - "flipOutY"=>'flipOutY', - "lightSpeedIn"=>'lightSpeedIn', - "lightSpeedOut"=>'lightSpeedOut', - "rotateIn"=>'rotateIn', - "rotateInDownLeft"=>'rotateInDownLeft', - "rotateInDownRight"=>'rotateInDownRight', - "rotateInUpLeft"=>'rotateInUpLeft', - "rotateInUpRight"=>'rotateInUpRight', - "rotateOut"=>'rotateOut', - "rotateOutDownLeft"=>'rotateOutDownLeft', - "rotateOutDownRight"=>'rotateOutDownRight', - "rotateOutUpLeft"=>'rotateOutUpLeft', - "rotateOutUpRight"=>'rotateOutUpRight', - "hinge"=>'hinge', - "rollIn"=>'rollIn', - "rollOut"=>'rollOut',"zoomIn"=>'zoomIn', - "zoomInDown"=>'zoomInDown', - "zoomInLeft"=>'zoomInLeft', - "zoomInRight"=>'zoomInRight', - "zoomInUp"=>'zoomInUp', - "zoomOut"=>'zoomOut', - "zoomOutDown"=>'zoomOutDown', - "zoomOutLeft"=>'zoomOutLeft', - "zoomOutRight"=>'zoomOutRight', - "zoomOutUp"=>'zoomOutUp' - ); - + "bounce" => 'bounce', + "flash" => 'flash', + "pulse" => 'pulse', + "rubberBand" => 'rubberBand', + "shake" => 'shake', + "swing" => 'swing', + "tada" => 'tada', + "wobble" => 'wobble', + "bounceIn" => 'bounceIn', + "bounceInDown" => 'bounceInDown', + "bounceInLeft" => 'bounceInLeft', + "bounceInRight" => 'bounceInRight', + "bounceInUp" => 'bounceInUp', + "bounceOut" => 'bounceOut', + "bounceOutDown" => 'bounceOutDown', + "bounceOutLeft" => 'bounceOutLeft', + "bounceOutRight" => 'bounceOutRight', + "bounceOutUp" => 'bounceOutUp', + "fadeIn" => 'fadeIn', + "fadeInDown" => 'fadeInDown', + "fadeInDownBig" => 'fadeInDownBig', + "fadeInLeft" => 'fadeInLeft', + "fadeInLeftBig" => 'fadeInLeftBig', + "fadeInRight" => 'fadeInRight', + "fadeInRightBig" => 'fadeInRightBig', + "fadeInUp" => 'fadeInUp', + "fadeInUpBig" => 'fadeInUpBig', + "fadeOut" => 'fadeOut', + "fadeOutDown" => 'fadeOutDown', + "fadeOutDownBig" => 'fadeOutDownBig', + "fadeOutLeft" => 'fadeOutLeft', + "fadeOutLeftBig" => 'fadeOutLeftBig', + "fadeOutRight" => 'fadeOutRight', + "fadeOutRightBig" => 'fadeOutRightBig', + "fadeOutUp" => 'fadeOutUp', + "fadeOutUpBig" => 'fadeOutUpBig', + "flip" => 'flip', + "flipInX" => 'flipInX', + "flipInY" => 'flipInY', + "flipOutX" => 'flipOutX', + "flipOutY" => 'flipOutY', + "lightSpeedIn" => 'lightSpeedIn', + "lightSpeedOut" => 'lightSpeedOut', + "rotateIn" => 'rotateIn', + "rotateInDownLeft" => 'rotateInDownLeft', + "rotateInDownRight" => 'rotateInDownRight', + "rotateInUpLeft" => 'rotateInUpLeft', + "rotateInUpRight" => 'rotateInUpRight', + "rotateOut" => 'rotateOut', + "rotateOutDownLeft" => 'rotateOutDownLeft', + "rotateOutDownRight" => 'rotateOutDownRight', + "rotateOutUpLeft" => 'rotateOutUpLeft', + "rotateOutUpRight" => 'rotateOutUpRight', + "hinge" => 'hinge', + "rollIn" => 'rollIn', + "rollOut" => 'rollOut', + "zoomIn" => 'zoomIn', + "zoomInDown" => 'zoomInDown', + "zoomInLeft" => 'zoomInLeft', + "zoomInRight" => 'zoomInRight', + "zoomInUp" => 'zoomInUp', + "zoomOut" => 'zoomOut', + "zoomOutDown" => 'zoomOutDown', + "zoomOutLeft" => 'zoomOutLeft', + "zoomOutRight" => 'zoomOutRight', + "zoomOutUp" => 'zoomOutUp' + ); + /*General Section*/ - + $arr_section['general'] = array( - 'title' => __('General', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/general.png', - 'icon_type' => 'image', - 'fields' => array ( - array( - 'id' => 'logo', - 'type' => 'media', - 'url' => false, - 'title' => __('Logo', 'anaglyph-lite'), - 'subtitle' => __('Change your Logo here, upload or enter the URL to your logo image.', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'images/logo.png'), - - ), - - array( - 'id' => 'logo-retina', - 'type' => 'media', - 'url' => false, - 'title' => __('Logo Retina ', 'anaglyph-lite'), - 'subtitle' => __('Upload your Retina Logo. This should be your Logo in double size (If your logo is 100 x 20px, it should be 200 x 40px)', 'anaglyph-lite'), - 'default' => array ('url' => $sample_patterns_url . 'images/logo@2x.png'), - ), + 'title' => __( 'General', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/general.png', + 'icon_type' => 'image', + 'fields' => array( + array( + 'id' => 'logo', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Logo', 'anaglyph-lite' ), + 'subtitle' => __( 'Change your Logo here, upload or enter the URL to your logo image.', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'images/logo.png' ), + + ), - array( - 'id' => 'logo-dimensions', - 'type' => 'dimensions', - 'units' => false, - 'title' => __('Original Logo (Width/Height)', 'anaglyph-lite'), - 'subtitle' => __("If Retina Logo uploaded, please enter the (width/height) of the Standard Logo you've uploaded (not the Retina Logo)", 'anaglyph-lite'), - 'default' => array( - 'width' => 129, - 'height' => 18, - ) + array( + 'id' => 'logo-retina', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Logo Retina ', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload your Retina Logo. This should be your Logo in double size (If your logo is 100 x 20px, it should be 200 x 40px)', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'images/logo@2x.png' ), + ), + + array( + 'id' => 'logo-dimensions', + 'type' => 'dimensions', + 'units' => false, + 'title' => __( 'Original Logo (Width/Height)', 'anaglyph-lite' ), + 'subtitle' => __( "If Retina Logo uploaded, please enter the (width/height) of the Standard Logo you've uploaded (not the Retina Logo)", 'anaglyph-lite' ), + 'default' => array( + 'width' => 129, + 'height' => 18, + ) + ), + + array( + 'id' => 'favicon', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Favicon', 'anaglyph-lite' ), + 'subtitle' => __( 'A favicon is a 16x16 pixel icon that represents your site; upload your custom Favicon here.', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'favicon/favicon-16x16.png' ), + ), + + array( + 'id' => 'favicon-iphone', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Favicon iPhone', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload a custom favicon for iPhone (57x57 pixel png).', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'favicon/favicon-57x57.png' ), + ), + + array( + 'id' => 'favicon-iphone-retina', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Favicon iPhone Retina', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload a custom favicon for iPhone retina (114x114 pixel png).', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'favicon/favicon-114x114.png' ), + ), + + array( + 'id' => 'favicon-ipad', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Favicon iPad', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload a custom favicon for iPad (72x72 pixel png).', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'favicon/favicon-72x72.png' ), + ), + + array( + 'id' => 'favicon-ipad-retina', + 'type' => 'media', + 'url' => false, + 'title' => __( 'Favicon iPad Retina', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload a custom favicon for iPhone retina (144x144 pixel png).', 'anaglyph-lite' ), + 'default' => array( 'url' => $sample_patterns_url . 'favicon/favicon-144x144.png' ), + ), + + array( + 'id' => 'ffc_statistic', + 'type' => 'checkbox', + 'title' => __( 'Fruitful Code statistic', 'anaglyph-lite' ), + 'subtitle' => __( 'Send configuration information to Fruitful Code to help to improve this theme', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '1', + ), + array( + 'id' => 'ffc_subscribe', + 'type' => 'checkbox', + 'title' => __( 'Subscribe to Newsletters', 'anaglyph-lite' ), + 'subtitle' => __( 'Subscribe to Newsletters', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '0', + ), + array( + 'id' => 'ffc_subscribe_name', + 'type' => 'text', + 'required' => array( 'ffc_subscribe', '=', '1' ), + 'title' => __( 'Name', 'anaglyph-lite' ), + //'validate' => 'not_empty', // errors in Redux on save + //'msg' => 'Type your name', // errors in Redux on save + 'default' => '', + 'placeholder' => 'Your Name' + ), + array( + 'id' => 'ffc_subscribe_email', + 'type' => 'text', + 'required' => array( 'ffc_subscribe', '=', '1' ), + 'title' => __( 'E-mail', 'anaglyph-lite' ), + //'validate' => 'email_not_empty', // errors in Redux on save + //'msg' => 'Type your email', // errors in Redux on save, + 'default' => '', + 'placeholder' => 'E-mail' + ), + array( + 'id' => 'ffc_is_hide_subscribe_notification', + 'default' => '0', + 'type' => 'checkbox', + 'class' => 'hidden' + ), + ) + ); + + /*Display options Section*/ + $arr_section['display'] = array( + 'title' => __( 'Display options', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/display-options.png', + 'icon_type' => 'image', + 'fields' => array( + + array( + 'id' => 'smoothscroll', + 'type' => 'checkbox', + 'title' => __( 'Enhanced scrolling', 'anaglyph-lite' ), + 'subtitle' => __( 'Select to enable scrolling library.', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '1', + 'data' => null + ), + + array( + 'id' => 'excerpt', + 'type' => 'select', + 'title' => __( 'Select Post Preview', 'anaglyph-lite' ), + 'subtitle' => __( 'Select showing full post, excerpt or title only', 'anaglyph-lite' ), + 'options' => array( + '1' => __( "Full post (before <-more->)", "anaglyph-lite" ), + '2' => __( "Excerpt", "anaglyph-lite" ), + '3' => __( "Only Title", "anaglyph-lite" ), ), - - array( - 'id' => 'favicon', - 'type' => 'media', - 'url' => false, - 'title' => __('Favicon', 'anaglyph-lite'), - 'subtitle' => __('A favicon is a 16x16 pixel icon that represents your site; upload your custom Favicon here.', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'favicon/favicon-16x16.png'), + 'default' => '2' + ), + + array( + 'id' => 'pp-comments', + 'type' => 'select', + 'title' => __( 'Display Comments', 'anaglyph-lite' ), + 'subtitle' => __( 'Choose where users are allowed to post comment in your website.', 'anaglyph-lite' ), + 'std' => 'post', + + 'options' => array( + 'post' => __( 'Posts Only', 'anaglyph-lite' ), + 'page' => __( 'Pages Only', 'anaglyph-lite' ), + 'both' => __( 'Posts/Pages show', 'anaglyph-lite' ), + 'none' => __( 'Hide all', 'anaglyph-lite' ), ), - - array( - 'id' => 'favicon-iphone', - 'type' => 'media', - 'url' => false, - 'title' => __('Favicon iPhone', 'anaglyph-lite'), - 'subtitle' => __('Upload a custom favicon for iPhone (57x57 pixel png).', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'favicon/favicon-57x57.png'), + 'default' => 'post' + ), + + array( + 'id' => 'pp-breadcrumbs', + 'type' => 'checkbox', + 'title' => __( 'Display Breadcrumbs', 'anaglyph-lite' ), + 'subtitle' => __( 'Display dynamic breadcrumbs on each page of your website.', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '1' + ), + + array( + 'id' => 'pp-blog', + 'type' => 'image_select', + 'title' => __( 'Blog page layout', 'anaglyph-lite' ), + 'subtitle' => __( 'Select main content and sidebar alignment.', 'anaglyph-lite' ), + 'options' => array( + '1' => array( 'alt' => '1 Column', 'img' => ReduxFramework::$_url . 'assets/img/1col.png' ), + '2' => array( + 'alt' => '2 Column Left', + 'img' => ReduxFramework::$_url . 'assets/img/2cl.png' + ), + '3' => array( + 'alt' => '2 Column Right', + 'img' => ReduxFramework::$_url . 'assets/img/2cr.png' + ), ), - - array( - 'id' => 'favicon-iphone-retina', - 'type' => 'media', - 'url' => false, - 'title' => __('Favicon iPhone Retina', 'anaglyph-lite'), - 'subtitle' => __('Upload a custom favicon for iPhone retina (114x114 pixel png).', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'favicon/favicon-114x114.png'), + 'default' => '1' + ), + + array( + 'id' => 'pp-post', + 'type' => 'image_select', + 'title' => __( 'Single post layout', 'anaglyph-lite' ), + 'subtitle' => __( 'Select main content and sidebar alignment.', 'anaglyph-lite' ), + 'options' => array( + '1' => array( 'alt' => '1 Column', 'img' => ReduxFramework::$_url . 'assets/img/1col.png' ), + '2' => array( + 'alt' => '2 Column Left', + 'img' => ReduxFramework::$_url . 'assets/img/2cl.png' + ), + '3' => array( + 'alt' => '2 Column Right', + 'img' => ReduxFramework::$_url . 'assets/img/2cr.png' + ), ), - - array( - 'id' => 'favicon-ipad', - 'type' => 'media', - 'url' => false, - 'title' => __('Favicon iPad', 'anaglyph-lite'), - 'subtitle' => __('Upload a custom favicon for iPad (72x72 pixel png).', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'favicon/favicon-72x72.png'), + 'default' => '3' + ), + + array( + 'id' => 'pp-columns', + 'type' => 'select', + 'title' => __( 'Select Columns', 'anaglyph-lite' ), + 'subtitle' => __( 'Select the number of columns for post showing.', 'anaglyph-lite' ), + 'options' => array( + '1' => __( "Full width", "anaglyph-lite" ), + '2' => __( "2 columns", "anaglyph-lite" ), + '3' => __( "3 columns", "anaglyph-lite" ), + '4' => __( "4 columns", "anaglyph-lite" ), ), - - array( - 'id' => 'favicon-ipad-retina', - 'type' => 'media', - 'url' => false, - 'title' => __('Favicon iPad Retina', 'anaglyph-lite'), - 'subtitle' => __('Upload a custom favicon for iPhone retina (144x144 pixel png).', 'anaglyph-lite'), - 'default' => array('url' => $sample_patterns_url . 'favicon/favicon-144x144.png'), + 'default' => '2' + ), + + array( + 'id' => 'pp-animations', + 'type' => 'select', + 'title' => __( 'Select animation for posts.', 'anaglyph-lite' ), + 'options' => array( + 'top' => __( "Top", "anaglyph-lite" ), + 'left' => __( "Left", "anaglyph-lite" ), + 'right' => __( "Right", "anaglyph-lite" ), + 'bottom' => __( "Bottom", "anaglyph-lite" ), + 'none' => __( "None", "anaglyph-lite" ), ), - + 'default' => 'bottom' + ), + array( + 'id' => 'pp-date', + 'type' => 'checkbox', + 'title' => __( 'Display date for posts', 'anaglyph-lite' ), + 'default' => true, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + array( + 'id' => 'pp-num-comments', + 'type' => 'checkbox', + 'title' => __( 'Display comments count for posts', 'anaglyph-lite' ), + 'default' => true, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + array( + 'id' => 'pp-thumbnail', + 'type' => 'checkbox', + 'title' => __( 'Display thumbnails for posts', 'anaglyph-lite' ), + 'default' => false, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + array( + 'id' => 'pp-thumbnail-single', + 'type' => 'checkbox', + 'title' => __( 'Display thumbnails for single post page', 'anaglyph-lite' ), + 'default' => false, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + array( + 'id' => 'pp-tags', + 'type' => 'checkbox', + 'title' => __( 'Display tags for posts', 'anaglyph-lite' ), + 'default' => true, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + + array( + 'id' => 'pp-authors', + 'type' => 'checkbox', + 'title' => __( 'Display authors for posts', 'anaglyph-lite' ), + 'default' => true, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + + array( + 'id' => 'pp-share', + 'type' => 'checkbox', + 'title' => __( 'Display share for post', 'anaglyph-lite' ), + 'default' => true, + 'class' => 'icheck', + 'desc' => __( 'Yes', 'anaglyph-lite' ), + ), + + array( + 'id' => 'pp-animation-mobile', + 'type' => 'checkbox', + 'title' => __( 'Disable all animations on all mobile devices', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '0' + ), + ) ); - - /*Display options Section*/ - $arr_section['display'] = array( - 'title' => __('Display options', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/display-options.png', - 'icon_type' => 'image', - 'fields' => array ( - - array( - 'id' => 'smoothscroll', - 'type' => 'checkbox', - 'title' => __('Enhanced scrolling', 'anaglyph-lite'), - 'subtitle' => __('Select to enable scrolling library.', 'anaglyph-lite'), - 'desc' => __('Yes', 'anaglyph-lite'), - 'class' => 'icheck', - 'default' => '1', - 'data' => null - ), - - array( - 'id' => 'excerpt', - 'type' => 'select', - 'title' => __('Select Post Preview', 'anaglyph-lite'), - 'subtitle' => __('Select showing full post, excerpt or title only', 'anaglyph-lite'), - 'options' => array( - '1' => __("Full post (before <-more->)", "anaglyph-lite"), - '2' => __("Excerpt", "anaglyph-lite"), - '3' => __("Only Title", "anaglyph-lite"), - ), - 'default' => '2' - ), - - array( - 'id' => 'pp-comments', - 'type' => 'select', - 'title' => __('Display Comments', 'anaglyph-lite'), - 'subtitle' => __('Choose where users are allowed to post comment in your website.', 'anaglyph-lite'), - 'std' => 'post', - - 'options' => array( - 'post' => __('Posts Only', 'anaglyph-lite'), - 'page' => __('Pages Only', 'anaglyph-lite'), - 'both' => __('Posts/Pages show', 'anaglyph-lite'), - 'none' => __('Hide all', 'anaglyph-lite'), - ), - 'default' => 'post' - ), - - array( - 'id' => 'pp-breadcrumbs', - 'type' => 'checkbox', - 'title' => __('Display Breadcrumbs', 'anaglyph-lite'), - 'subtitle' => __('Display dynamic breadcrumbs on each page of your website.', 'anaglyph-lite'), - 'desc' => __('Yes', 'anaglyph-lite'), - 'class' => 'icheck', - 'default' => '1' - ), - - array( - 'id' => 'pp-blog', - 'type' => 'image_select', - 'title' => __('Blog page layout', 'anaglyph-lite'), - 'subtitle' => __('Select main content and sidebar alignment.', 'anaglyph-lite'), - 'options' => array( - '1' => array('alt' => '1 Column', 'img' => ReduxFramework::$_url . 'assets/img/1col.png'), - '2' => array('alt' => '2 Column Left', 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'), - '3' => array('alt' => '2 Column Right', 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'), - ), - 'default' => '1' - ), - - array( - 'id' => 'pp-post', - 'type' => 'image_select', - 'title' => __('Single post layout', 'anaglyph-lite'), - 'subtitle' => __('Select main content and sidebar alignment.', 'anaglyph-lite'), - 'options' => array( - '1' => array('alt' => '1 Column', 'img' => ReduxFramework::$_url . 'assets/img/1col.png'), - '2' => array('alt' => '2 Column Left', 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'), - '3' => array('alt' => '2 Column Right', 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'), - ), - 'default' => '3' - ), - - array( - 'id' => 'pp-columns', - 'type' => 'select', - 'title' => __('Select Columns', 'anaglyph-lite'), - 'subtitle' => __('Select the number of columns for post showing.', 'anaglyph-lite'), - 'options' => array( - '1' => __("Full width", "anaglyph-lite"), - '2' => __("2 columns", "anaglyph-lite"), - '3' => __("3 columns", "anaglyph-lite"), - '4' => __("4 columns", "anaglyph-lite"), - ), - 'default' => '2' - ), - - array( - 'id' => 'pp-animations', - 'type' => 'select', - 'title' => __('Select animation for posts.', 'anaglyph-lite'), - 'options' => array( - 'top' => __("Top", "anaglyph-lite"), - 'left' => __("Left", "anaglyph-lite"), - 'right' => __("Right", "anaglyph-lite"), - 'bottom' => __("Bottom", "anaglyph-lite"), - 'none' => __("None", "anaglyph-lite"), - ), - 'default' => 'bottom' - ), - array( - 'id' => 'pp-date', - 'type' => 'checkbox', - 'title' => __('Display date for posts', 'anaglyph-lite'), - 'default' => true, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - array( - 'id' => 'pp-num-comments', - 'type' => 'checkbox', - 'title' => __('Display comments count for posts', 'anaglyph-lite'), - 'default' => true, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - array( - 'id' => 'pp-thumbnail', - 'type' => 'checkbox', - 'title' => __('Display thumbnails for posts', 'anaglyph-lite'), - 'default' => false, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - array( - 'id' => 'pp-thumbnail-single', - 'type' => 'checkbox', - 'title' => __('Display thumbnails for single post page', 'anaglyph-lite'), - 'default' => false, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - array( - 'id' => 'pp-tags', - 'type' => 'checkbox', - 'title' => __('Display tags for posts', 'anaglyph-lite'), - 'default' => true, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - - array( - 'id' => 'pp-authors', - 'type' => 'checkbox', - 'title' => __('Display authors for posts', 'anaglyph-lite'), - 'default' => true, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - - array( - 'id' => 'pp-share', - 'type' => 'checkbox', - 'title' => __('Display share for post', 'anaglyph-lite'), - 'default' => true, - 'class' => 'icheck', - 'desc' => __('Yes', 'anaglyph-lite'), - ), - - array( - 'id' => 'pp-animation-mobile', - 'type' => 'checkbox', - 'title' => __('Disable all animations on all mobile devices', 'anaglyph-lite'), - 'desc' => __('Yes', 'anaglyph-lite'), - 'class' => 'icheck', - 'default' => '0' - ), - - ) - ); - + /*Styling options Section*/ $arr_section['styling'] = array( - 'title' => __('Styling', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/styling.png', - 'icon_type' => 'image', - 'fields' => array ( - array( - 'id' => 'body-background', - 'type' => 'background', - 'output' => array('body'), - 'title' => __('Body Background', 'anaglyph-lite'), - 'subtitle' => __('Body background with image, color, etc.', 'anaglyph-lite'), - 'transparent' => false, - 'default' => array( - 'background-color' => '#ffffff', - 'background-repeat' => 'inherit', - 'background-attachment' => 'inherit', - 'background-position' => 'top center', - 'background-size' => 'inherit', + 'title' => __( 'Styling', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/styling.png', + 'icon_type' => 'image', + 'fields' => array( + array( + 'id' => 'body-background', + 'type' => 'background', + 'output' => array( 'body' ), + 'title' => __( 'Body Background', 'anaglyph-lite' ), + 'subtitle' => __( 'Body background with image, color, etc.', 'anaglyph-lite' ), + 'transparent' => false, + 'default' => array( + 'background-color' => '#ffffff', + 'background-repeat' => 'inherit', + 'background-attachment' => 'inherit', + 'background-position' => 'top center', + 'background-size' => 'inherit', ) - ), - - array( - 'id' => 'headline-section', - 'type' => 'section', - 'title' => __('Headline options', 'anaglyph-lite'), - 'indent' => true - ), - - array( - 'id' => 'headline-before-sep-color', - 'type' => 'color', - 'title' => __('Headline before color separator.', 'anaglyph-lite'), - 'default' => '#FACE00', - 'validate' => 'color', - 'transparent' => false - ), - - array( - 'id' => 'headline-after-sep-color', - 'type' => 'color', - 'title' => __('Headline after color separator.', 'anaglyph-lite'), - 'default' => '#E23A00', - 'validate' => 'color', - 'transparent' => false - ), - - array( - 'id' => 'top-title-section', - 'type' => 'section', - 'title' => __('Page title options', 'anaglyph-lite'), - 'indent' => true - ), - - array( - 'id' => 'top-title-text', - 'type' => 'typography', - 'title' => __('Page title text options.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, + ), + + array( + 'id' => 'headline-section', + 'type' => 'section', + 'title' => __( 'Headline options', 'anaglyph-lite' ), + 'indent' => true + ), + + array( + 'id' => 'headline-before-sep-color', + 'type' => 'color', + 'title' => __( 'Headline before color separator.', 'anaglyph-lite' ), + 'default' => '#FACE00', + 'validate' => 'color', + 'transparent' => false + ), + + array( + 'id' => 'headline-after-sep-color', + 'type' => 'color', + 'title' => __( 'Headline after color separator.', 'anaglyph-lite' ), + 'default' => '#E23A00', + 'validate' => 'color', + 'transparent' => false + ), + + array( + 'id' => 'top-title-section', + 'type' => 'section', + 'title' => __( 'Page title options', 'anaglyph-lite' ), + 'indent' => true + ), + + array( + 'id' => 'top-title-text', + 'type' => 'typography', + 'title' => __( 'Page title text options.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, 'text-transform' => true, - 'subsets' => true, - 'output' => array('.sub-page #page-title .title h1'), - 'units' =>'px', - 'subtitle' => __('Select typography for title text.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#ffffff', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '48px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'Page Title') - ), - - array( - 'id' => 'top-title-bg-color', - 'type' => 'color_rgba', - 'title' => __('Page title text background color.', 'anaglyph-lite'), - 'default' => array('color' => '#000000', 'alpha' => '0.8'), - 'mode' => 'color', - 'validate' => 'colorrgba', - 'transparent' => false - ), - - array( - 'id' => 'blog-section', - 'type' => 'section', - 'title' => __('Blog options', 'anaglyph-lite'), - 'indent' => true - ), - - array( - 'id' => 'blog-date-text', - 'type' => 'typography', - 'title' => __('Blog date text options.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, + 'subsets' => true, + 'output' => array( '.sub-page #page-title .title h1' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for title text.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#ffffff', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '48px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => __( 'Page Title', 'anaglyph-lite' ) ) + ), + + array( + 'id' => 'top-title-bg-color', + 'type' => 'color_rgba', + 'title' => __( 'Page title text background color.', 'anaglyph-lite' ), + 'default' => array( 'color' => '#000000', 'alpha' => '0.8' ), + 'mode' => 'color', + 'validate' => 'colorrgba', + 'transparent' => false + ), + + array( + 'id' => 'blog-section', + 'type' => 'section', + 'title' => __( 'Blog options', 'anaglyph-lite' ), + 'indent' => true + ), + + array( + 'id' => 'blog-date-text', + 'type' => 'typography', + 'title' => __( 'Blog date text options.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'subsets' => true, - 'output' => array('.blog-post .date-circle', '.blog-post .date-circle'), - 'units' =>'px', - 'subtitle' => __('Select typography for title text.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#ffffff', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px' - ), - 'preview' => array('text' => 'Blog date') - ), - - array( - 'id' => 'blog-date-bg-color', - 'type' => 'color', - 'title' => __('Blog date background color.', 'anaglyph-lite'), - 'default' => '#292422', - 'mode' => 'color', - 'transparent' => false - ), - - array( - 'id' => 'navigation-section', - 'type' => 'section', - 'title' => __('Post navigation options', 'anaglyph-lite'), - 'indent' => true - ), - - array( - 'id' => 'navigation-text', - 'type' => 'typography', - 'title' => __('Navigation text options.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, + 'line-height' => false, + 'text-align' => false, + 'subsets' => true, + 'output' => array( '.blog-post .date-circle', '.blog-post .date-circle' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for title text.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#ffffff', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px' + ), + 'preview' => array( 'text' => __( 'Blog date', 'anaglyph-lite' ) ) + ), + + array( + 'id' => 'blog-date-bg-color', + 'type' => 'color', + 'title' => __( 'Blog date background color.', 'anaglyph-lite' ), + 'default' => '#292422', + 'mode' => 'color', + 'transparent' => false + ), + + array( + 'id' => 'navigation-section', + 'type' => 'section', + 'title' => __( 'Post navigation options', 'anaglyph-lite' ), + 'indent' => true + ), + + array( + 'id' => 'navigation-text', + 'type' => 'typography', + 'title' => __( 'Navigation text options.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'color' => false, - 'preview' => false, - 'subsets' => true, - 'output' => array('.pagination li a, .pagination li span'), - 'units' =>'px', - 'subtitle' => __('Select typography for page navigation text.', 'anaglyph-lite'), - 'default' => array( - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px' - ), - ), - - array( - 'id' => 'navigation-border', - 'type' => 'border', - 'title' => __('Navigation border.', 'anaglyph-lite'), - 'color' => false, - 'default' => array( - 'border-style' => 'solid', - 'border-top' => '2px', - 'border-right' => '2px', - 'border-bottom' => '2px', - 'border-left' => '2px' - ) - ), - - array( - 'id' => 'navigation-border-color', - 'type' => 'link_color', - 'title' => __('Navigation border color.', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#999999', - 'hover' => '#000000', - 'active' => '#E23A00', - ) - ), - - array( - 'id' => 'navigation-link-color', - 'type' => 'link_color', - 'title' => __('Navigation link color.', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#292422', - 'hover' => '#292422', - 'active' => '#ffffff', - ) - ), - - - array( - 'id' => 'navigation-bglink-color', - 'type' => 'link_color', - 'title' => __('Navigation background link color.', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#ffffff', - 'hover' => '#ffffff', - 'active' => '#E23A00', - ) - ), - - + 'line-height' => false, + 'text-align' => false, + 'color' => false, + 'preview' => false, + 'subsets' => true, + 'output' => array( '.pagination li a, .pagination li span' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for page navigation text.', 'anaglyph-lite' ), + 'default' => array( + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px' + ), + ), + + array( + 'id' => 'navigation-border', + 'type' => 'border', + 'title' => __( 'Navigation border.', 'anaglyph-lite' ), + 'color' => false, + 'default' => array( + 'border-style' => 'solid', + 'border-top' => '2px', + 'border-right' => '2px', + 'border-bottom' => '2px', + 'border-left' => '2px' + ) + ), + + array( + 'id' => 'navigation-border-color', + 'type' => 'link_color', + 'title' => __( 'Navigation border color.', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#999999', + 'hover' => '#000000', + 'active' => '#E23A00', + ) + ), + + array( + 'id' => 'navigation-link-color', + 'type' => 'link_color', + 'title' => __( 'Navigation link color.', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#292422', + 'hover' => '#292422', + 'active' => '#ffffff', + ) + ), + + + array( + 'id' => 'navigation-bglink-color', + 'type' => 'link_color', + 'title' => __( 'Navigation background link color.', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#ffffff', + 'hover' => '#ffffff', + 'active' => '#E23A00', + ) + ), + + ) ); - - + + $pages_list = array(); - + $args_query_pages = array( - 'post_status' => 'publish', - 'post_type' => array('post', 'page'), - 'posts_per_page' => -1 + 'post_status' => 'publish', + 'post_type' => array( 'post', 'page' ), + 'posts_per_page' => - 1 ); - $pages_array = get_posts( $args_query_pages ); - if (!empty($pages_array)){ + $pages_array = get_posts( $args_query_pages ); + if ( ! empty( $pages_array ) ) { foreach ( $pages_array as $page_item ) { - $pages_list[$page_item->ID] = $page_item->post_title; + $pages_list[ $page_item->ID ] = $page_item->post_title; } } - + /*Slider Section*/ $arr_section['slider'] = array( - 'title' => __('Slider', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/slider.png', - 'icon_type' => 'image', - 'fields' => array ( - - array( - 'id' => 'switch-slider', - 'type' => 'switch', - 'title' => __('Slider on "Home" page', 'anaglyph-lite'), - 'default' => 0, - 'on' => 'On', - 'off' => 'Off', - ), - - array( - 'id' => 'home-slides', - 'type' => 'select', - 'required' => array('switch-slider', '=', '1'), - 'multi' => true, - 'title' => __('Slides', 'anaglyph-lite'), - 'subtitle' => __('Select pages or posts', 'anaglyph-lite'), - 'desc' => __('You can sort it.', 'anaglyph-lite'), - 'placeholder' => __('Page or post name.', 'anaglyph-lite'), - 'sortable' => true, - 'options' => $pages_list - ), - - array( - 'id' => 'slider-links', - 'type' => 'checkbox', - 'required' => array('switch-slider', '=', '1'), - 'title' => __('Link to page', 'anaglyph-lite'), - 'desc' => __('Yes', 'anaglyph-lite'), - 'default' => '1' - ), - - array( - 'id' => 'slider-parallax', - 'type' => 'checkbox', - 'required' => array('switch-slider', '=', '1'), - 'title' => __('Enable parallax', 'anaglyph-lite'), - 'subtitle' => __('Select to enable parallax effect.', 'anaglyph-lite'), - 'desc' => __('Yes', 'anaglyph-lite'), - 'class' => 'icheck', - 'default' => '1', - 'data' => null - ), - - array( - 'id' => 'slider-showspeed', - 'type' => 'slider', - 'required' => array('switch-slider', '=', '1'), - 'title' => __('Slideshow Speed', 'anaglyph-lite'), - 'desc' => __('Min: 1000, max: 28000, step: 500, default value: 8000', 'anaglyph-lite'), - 'default' => 8000, - 'min' => 1000, - 'step' => 500, - 'max' => 28000, - 'display_value' => 'text' - ), - - array( - 'id' => 'slider-animationeffect-in', - 'type' => 'select', - 'title' => __('Select animation in', 'anaglyph-lite'), - 'options' => $arr_slider_effects, - 'default' => 'flipInX', - 'required' => array('switch-slider', '=', '1'), - ), - - array( - 'id' => 'slider-animationeffect-out', - 'type' => 'select', - 'title' => __('Select animation out', 'anaglyph-lite'), - 'options' => $arr_slider_effects, - 'default' => 'fadeOutUp', - 'required' => array('switch-slider', '=', '1'), - ), - - array( - 'id' => 'slider-typography', - 'type' => 'typography', - 'title' => __('Slider title', 'anaglyph-lite'), - 'required' => array('switch-slider', '=', '1'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('#slider .flexslider .slides .slide .slide-content .slide-wrapper h1'), - 'units' =>'px', - 'subtitle' => __('Select typography for general text.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#fff', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '72px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text') - ), - - array( - 'id' => 'slider-sub-typography', - 'type' => 'typography', - 'title' => __('Slider subtitle', 'anaglyph-lite'), - 'required' => array('switch-slider', '=', '1'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('#slider .flexslider .slides .slide .slide-content .slide-wrapper h3'), - 'units' =>'px', - 'subtitle' => __('Select typography for subtitle.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#fff', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '36px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text') - ), - - array( - 'id' => 'slider-title-bg-color', - 'type' => 'color_rgba', - 'title' => __('Slider title background color.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#000000', + 'title' => __( 'Slider', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/slider.png', + 'icon_type' => 'image', + 'fields' => array( + + array( + 'id' => 'switch-slider', + 'type' => 'switch', + 'title' => __( 'Slider on "Home" page', 'anaglyph-lite' ), + 'default' => 0, + 'on' => 'On', + 'off' => 'Off', + ), + + array( + 'id' => 'home-slides', + 'type' => 'select', + 'required' => array( 'switch-slider', '=', '1' ), + 'multi' => true, + 'title' => __( 'Slides', 'anaglyph-lite' ), + 'subtitle' => __( 'Select pages or posts', 'anaglyph-lite' ), + 'desc' => __( 'You can sort it.', 'anaglyph-lite' ), + 'placeholder' => __( 'Page or post name.', 'anaglyph-lite' ), + 'sortable' => true, + 'options' => $pages_list + ), + + array( + 'id' => 'slider-links', + 'type' => 'checkbox', + 'required' => array( 'switch-slider', '=', '1' ), + 'title' => __( 'Link to page', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'default' => '1' + ), + + array( + 'id' => 'slider-parallax', + 'type' => 'checkbox', + 'required' => array( 'switch-slider', '=', '1' ), + 'title' => __( 'Enable parallax', 'anaglyph-lite' ), + 'subtitle' => __( 'Select to enable parallax effect.', 'anaglyph-lite' ), + 'desc' => __( 'Yes', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '1', + 'data' => null + ), + + array( + 'id' => 'slider-showspeed', + 'type' => 'slider', + 'required' => array( 'switch-slider', '=', '1' ), + 'title' => __( 'Slideshow Speed', 'anaglyph-lite' ), + 'desc' => __( 'Min: 1000, max: 28000, step: 500, default value: 8000', 'anaglyph-lite' ), + 'default' => 8000, + 'min' => 1000, + 'step' => 500, + 'max' => 28000, + 'display_value' => 'text' + ), + + array( + 'id' => 'slider-animationeffect-in', + 'type' => 'select', + 'title' => __( 'Select animation in', 'anaglyph-lite' ), + 'options' => $arr_slider_effects, + 'default' => 'flipInX', + 'required' => array( 'switch-slider', '=', '1' ), + ), + + array( + 'id' => 'slider-animationeffect-out', + 'type' => 'select', + 'title' => __( 'Select animation out', 'anaglyph-lite' ), + 'options' => $arr_slider_effects, + 'default' => 'fadeOutUp', + 'required' => array( 'switch-slider', '=', '1' ), + ), + + array( + 'id' => 'slider-typography', + 'type' => 'typography', + 'title' => __( 'Slider title', 'anaglyph-lite' ), + 'required' => array( 'switch-slider', '=', '1' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( '#slider .flexslider .slides .slide .slide-content .slide-wrapper h1' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for general text.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#fff', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '72px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ) + ), + + array( + 'id' => 'slider-sub-typography', + 'type' => 'typography', + 'title' => __( 'Slider subtitle', 'anaglyph-lite' ), + 'required' => array( 'switch-slider', '=', '1' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( '#slider .flexslider .slides .slide .slide-content .slide-wrapper h3' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for subtitle.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#fff', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '36px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ) + ), + + array( + 'id' => 'slider-title-bg-color', + 'type' => 'color_rgba', + 'title' => __( 'Slider title background color.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#000000', 'alpha' => '0.9' ), - 'transparent' => false, - 'mode' => 'background', - 'required' => array('switch-slider', '=', '1'), - ), - + 'transparent' => false, + 'mode' => 'background', + 'required' => array( 'switch-slider', '=', '1' ), + ), + ) - + ); - + /*Header Section*/ $arr_section['header'] = array( - 'title' => __('Header', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/header.png', + 'title' => __( 'Header', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/header.png', 'icon_type' => 'image', - 'fields' => array( - array( - 'id' => 'header-background-color', - 'type' => 'color', - 'title' => __('Header background color', 'anaglyph-lite'), - 'default' => '#FFFFFF', - 'validate' => 'color', - 'transparent' => true - ), - - array( - 'id' => 'header-fixed-settings', - 'type' => 'select', - 'title' => __('Select animation in', 'anaglyph-lite'), - 'options' => array( - '1' => __('Fixed header on home page', 'anaglyph-lite'), - '2' => __('Fixed header for all pages', 'anaglyph-lite'), - '3' => __('Disable fixed header', 'anaglyph-lite'), - ), - 'default' => '1', - 'std' => '1' - ), - - array( - 'id' => 'header-spacing', - 'type' => 'spacing', - 'output' => array('.navigation-wrapper .navigation'), - 'mode' => 'padding', - 'all' => false, - 'left' => false, - 'right' => false, - 'units' => array('em','px','%'), - 'units_extended' => 'true', - 'title' => __('Padding Option', 'anaglyph-lite'), - 'subtitle' => __('Allow your users to choose the spacing or margin they want.', 'anaglyph-lite'), - 'default' => array( - 'padding-top' => 10, - 'padding-bottom' => 10 - ) - ), + 'fields' => array( + array( + 'id' => 'header-background-color', + 'type' => 'color', + 'title' => __( 'Header background color', 'anaglyph-lite' ), + 'default' => '#FFFFFF', + 'validate' => 'color', + 'transparent' => true + ), + + array( + 'id' => 'header-fixed-settings', + 'type' => 'select', + 'title' => __( 'Select animation in', 'anaglyph-lite' ), + 'options' => array( + '1' => __( 'Fixed header on home page', 'anaglyph-lite' ), + '2' => __( 'Fixed header for all pages', 'anaglyph-lite' ), + '3' => __( 'Disable fixed header', 'anaglyph-lite' ), + ), + 'default' => '1', + 'std' => '1' + ), + + array( + 'id' => 'header-spacing', + 'type' => 'spacing', + 'output' => array( '.navigation-wrapper .navigation' ), + 'mode' => 'padding', + 'all' => false, + 'left' => false, + 'right' => false, + 'units' => array( 'em', 'px', '%' ), + 'units_extended' => 'true', + 'title' => __( 'Padding Option', 'anaglyph-lite' ), + 'subtitle' => __( 'Allow your users to choose the spacing or margin they want.', 'anaglyph-lite' ), + 'default' => array( + 'padding-top' => 10, + 'padding-bottom' => 10 + ) + ), ) ); - - + + /*Menu Section*/ $arr_section['menu'] = array( - 'title' => __('Menu', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/menu.png', + 'title' => __( 'Menu', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/menu.png', 'icon_type' => 'image', - 'fields' => array( - - array( - 'id' => 'menu-font-settings', - 'type' => 'typography', - 'title' => __('Menu font settings', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'color' => false, - 'text-transform' => true, - 'output' => array('.navigation-wrapper .navigation .nav li a'), - 'units' =>'px', - 'subsets' => true, - 'subtitle' => __('Select typography for general text.', 'anaglyph-lite'), - 'default' => array( - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text') - ), - - array( - 'id' => 'menu-link-color', - 'type' => 'link_color', - 'title' => __('Menu item color', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#292422', - 'hover' => '#292422', - 'active' => '#292422', - ) - ), - array( - 'id' => 'submenu-link-color', - 'type' => 'link_color', - 'title' => __('Submenu item color', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#292422', - 'hover' => '#E23A00', - 'active' => '#E23A00', - ) - ), - - array( - 'id' => 'submenu-itembg-color', - 'type' => 'link_color', - 'title' => __('Submenu item background color', 'anaglyph-lite'), - 'default' => array( - 'regular' => '#EDEAE6', - 'hover' => '#FFFFFF', - 'active' => '#FFFFFF', - ) - ), - - array( - 'id' => 'submenu-color', - 'type' => 'color', - 'title' => __('Submenu background color', 'anaglyph-lite'), - 'default' => '#EDEAE6', - 'validate' => 'color', - 'transparent' => false - ), - - array( - 'id' => 'submenu-itemborder-color', - 'type' => 'color_rgba', - 'title' => __('Submenu item border color', 'anaglyph-lite'), - 'default' => array('color' => '#000000', 'alpha' => '0.05'), - 'mode' => 'color', - 'validate' => 'colorrgba', - 'transparent' => false - ), - - array( - 'id' => 'before-item-color', - 'type' => 'color', - 'title' => __('Menu before item color.', 'anaglyph-lite'), - 'default' => '#E23A00', - 'validate' => 'color', - 'transparent' => false - ), - - array( - 'id' => 'after-item-color', - 'type' => 'color', - 'title' => __('Menu after item color.', 'anaglyph-lite'), - 'default' => '#FACE00', - 'validate' => 'color', - 'transparent' => false - ), + 'fields' => array( + + array( + 'id' => 'menu-font-settings', + 'type' => 'typography', + 'title' => __( 'Menu font settings', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'color' => false, + 'text-transform' => true, + 'output' => array( '.navigation-wrapper .navigation .nav li a' ), + 'units' => 'px', + 'subsets' => true, + 'subtitle' => __( 'Select typography for general text.', 'anaglyph-lite' ), + 'default' => array( + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ) + ), + + array( + 'id' => 'menu-link-color', + 'type' => 'link_color', + 'title' => __( 'Menu item color', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#292422', + 'hover' => '#292422', + 'active' => '#292422', + ) + ), + array( + 'id' => 'submenu-link-color', + 'type' => 'link_color', + 'title' => __( 'Submenu item color', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#292422', + 'hover' => '#E23A00', + 'active' => '#E23A00', + ) + ), + + array( + 'id' => 'submenu-itembg-color', + 'type' => 'link_color', + 'title' => __( 'Submenu item background color', 'anaglyph-lite' ), + 'default' => array( + 'regular' => '#EDEAE6', + 'hover' => '#FFFFFF', + 'active' => '#FFFFFF', + ) + ), + + array( + 'id' => 'submenu-color', + 'type' => 'color', + 'title' => __( 'Submenu background color', 'anaglyph-lite' ), + 'default' => '#EDEAE6', + 'validate' => 'color', + 'transparent' => false + ), + + array( + 'id' => 'submenu-itemborder-color', + 'type' => 'color_rgba', + 'title' => __( 'Submenu item border color', 'anaglyph-lite' ), + 'default' => array( 'color' => '#000000', 'alpha' => '0.05' ), + 'mode' => 'color', + 'validate' => 'colorrgba', + 'transparent' => false + ), + + array( + 'id' => 'before-item-color', + 'type' => 'color', + 'title' => __( 'Menu before item color.', 'anaglyph-lite' ), + 'default' => '#E23A00', + 'validate' => 'color', + 'transparent' => false + ), + + array( + 'id' => 'after-item-color', + 'type' => 'color', + 'title' => __( 'Menu after item color.', 'anaglyph-lite' ), + 'default' => '#FACE00', + 'validate' => 'color', + 'transparent' => false + ), ) ); - + /*Font Styles Section*/ $arr_section['font-style'] = array( - 'title' => __('Font styles', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/fonts.png', + 'title' => __( 'Font styles', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/fonts.png', 'icon_type' => 'image', - 'fields' => array( - array( - 'id' => 'general-typography', - 'type' => 'typography', - 'title' => __('General Text Font Style', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'output' => array('body'), - 'units' =>'px', - 'subsets' => true, - 'subtitle' => __('Select typography for general text.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px' - ), - 'preview' => array('text' => 'sample text') - ), - - array( - 'id' => 'p-opacity', - 'type' => 'slider', - 'title' => __('Transparency for content', 'anaglyph-lite'), - 'subtitle' => __('Set the opacity for the content part', 'anaglyph-lite'), - 'default' => .65, - 'min' => 0, - 'step' => .1, - 'max' => 1, - 'resolution' => 0.1, - 'display_value' => 'label' - ), - - array( - 'id' => 'hone-typography', - 'type' => 'typography', - 'title' => __('H1 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'output' => array('h1'), - 'subsets' => true, - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H1.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '72px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text') - ), - array( - 'id' => 'htwo-typography', - 'type' => 'typography', - 'title' => __('H2 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('h2'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H2.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '36px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text'), - ), - array( - 'id' => 'hthree-typography', - 'type' => 'typography', - 'title' => __('H3 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('h3'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H3.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '24px', - 'text-transform' => 'none' - ), - 'preview' => array('text' => 'sample text'), - ), - - array( - 'id' => 'hfour-typography', - 'type' => 'typography', - 'title' => __('H4 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('h4'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H4.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '700', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '18px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text'), - ), - array( - 'id' => 'hfive-typography', - 'type' => 'typography', - 'title' => __('H5 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('h5'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H5.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text'), - ), - - array( - 'id' => 'hsix-typography', - 'type' => 'typography', - 'title' => __('H6 Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'text-transform' => true, - 'subsets' => true, - 'output' => array('h6'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for header H6.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#333', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px', - 'text-transform' => 'uppercase' - ), - 'preview' => array('text' => 'sample text'), - ), - - array( - 'id' => 'p-typography', - 'type' => 'typography', - 'title' => __('"p" Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => true, - 'text-align' => true, - 'subsets' => true, - 'output' => array('p'), - 'units' =>'px', - 'subtitle' => __('Select the typography you want for tag "p".', 'anaglyph-lite'), - 'default' => array( - 'color' => '#292422', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px', - 'line-height' => '24px', - 'text-align' => 'inherit' - - ), - 'preview' => array('text' => 'sample text'), - ), - - array( - 'id' => 'content-link-color', - 'type' => 'link_color', - 'title' => __('Link style.', 'anaglyph-lite'), - 'subtitle' => __('Select the typography you want for tag "a".', 'anaglyph-lite'), - 'output' => array('a'), - 'default' => array( - 'regular' => '#292422', - 'hover' => '#e23a00', - 'active' => '#e23a00', - ) - ), + 'fields' => array( + array( + 'id' => 'general-typography', + 'type' => 'typography', + 'title' => __( 'General Text Font Style', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'output' => array( 'body' ), + 'units' => 'px', + 'subsets' => true, + 'subtitle' => __( 'Select typography for general text.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px' + ), + 'preview' => array( 'text' => 'sample text' ) + ), - ) + array( + 'id' => 'p-opacity', + 'type' => 'slider', + 'title' => __( 'Transparency for content', 'anaglyph-lite' ), + 'subtitle' => __( 'Set the opacity for the content part', 'anaglyph-lite' ), + 'default' => .65, + 'min' => 0, + 'step' => .1, + 'max' => 1, + 'resolution' => 0.1, + 'display_value' => 'label' + ), + + array( + 'id' => 'hone-typography', + 'type' => 'typography', + 'title' => __( 'H1 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'output' => array( 'h1' ), + 'subsets' => true, + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H1.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '72px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ) + ), + array( + 'id' => 'htwo-typography', + 'type' => 'typography', + 'title' => __( 'H2 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( 'h2' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H2.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '36px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ), + ), + array( + 'id' => 'hthree-typography', + 'type' => 'typography', + 'title' => __( 'H3 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( 'h3' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H3.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '24px', + 'text-transform' => 'none' + ), + 'preview' => array( 'text' => 'sample text' ), + ), + + array( + 'id' => 'hfour-typography', + 'type' => 'typography', + 'title' => __( 'H4 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( 'h4' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H4.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '700', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '18px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ), + ), + array( + 'id' => 'hfive-typography', + 'type' => 'typography', + 'title' => __( 'H5 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( 'h5' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H5.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ), + ), + + array( + 'id' => 'hsix-typography', + 'type' => 'typography', + 'title' => __( 'H6 Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'text-transform' => true, + 'subsets' => true, + 'output' => array( 'h6' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for header H6.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#333', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px', + 'text-transform' => 'uppercase' + ), + 'preview' => array( 'text' => 'sample text' ), + ), + + array( + 'id' => 'p-typography', + 'type' => 'typography', + 'title' => __( '"p" Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => true, + 'text-align' => true, + 'subsets' => true, + 'output' => array( 'p' ), + 'units' => 'px', + 'subtitle' => __( 'Select the typography you want for tag "p".', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#292422', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px', + 'line-height' => '24px', + 'text-align' => 'inherit' + + ), + 'preview' => array( 'text' => 'sample text' ), + ), + + array( + 'id' => 'content-link-color', + 'type' => 'link_color', + 'title' => __( 'Link style.', 'anaglyph-lite' ), + 'subtitle' => __( 'Select the typography you want for tag "a".', 'anaglyph-lite' ), + 'output' => array( 'a' ), + 'default' => array( + 'regular' => '#292422', + 'hover' => '#e23a00', + 'active' => '#e23a00', + ) + ), + + ) ); - + /*Social Section*/ $arr_section['social'] = array( - 'title' => __('Social Links', 'anaglyph-lite'), - 'desc' => __('Add link to your social media profiles. Icons with link will be display in header or footer.', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/social-links.png', + 'title' => __( 'Social Links', 'anaglyph-lite' ), + 'desc' => __( 'Add link to your social media profiles. Icons with link will be display in header or footer.', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/social-links.png', 'icon_type' => 'image', 'fields' => array( array( - 'id' => 'facebook-url', - 'type' => 'text', - 'title' => __('Facebook', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'twitter-url', - 'type' => 'text', - 'title' => __('Twitter', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'linkedin-url', - 'type' => 'text', - 'title' => __('LinkedIn', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'myspace-url', - 'type' => 'text', - 'title' => __('MySpace', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'gplus-url', - 'type' => 'text', - 'title' => __('Google Plus+', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'dribbble-url', - 'type' => 'text', - 'title' => __('Dribbble', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'flickr-url', - 'type' => 'text', - 'title' => __('Flickr', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'youtube-url', - 'type' => 'text', - 'title' => __('You Tube', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'delicious-url', - 'type' => 'text', - 'title' => __('Delicious', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'deviantart-url', - 'type' => 'text', - 'title' => __('Deviantart', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'rss-url', - 'type' => 'text', - 'title' => __('RSS', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'instagram-url', - 'type' => 'text', - 'title' => __('Instagram', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'pinterest-url', - 'type' => 'text', - 'title' => __('Pinterest', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'vimeo-url', - 'type' => 'text', - 'title' => __('Vimeo', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'picassa-url', - 'type' => 'text', - 'title' => __('Picassa', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'tumblr-url', - 'type' => 'text', - 'title' => __('Tumblr', 'anaglyph-lite'), - 'validate' => 'url', - 'default' => '' - ), - array( - 'id' => 'email-address', - 'type' => 'text', - 'title' => __('E-mail', 'anaglyph-lite'), - 'validate' => 'email', - 'msg' => 'custom error message', - 'default' => '' - ), - array( - 'id' => 'skype-username', - 'type' => 'text', - 'title' => __('Skype', 'anaglyph-lite'), - 'default' => '' - ), - ) - ); - - include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + 'id' => 'facebook-url', + 'type' => 'text', + 'title' => __( 'Facebook', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'twitter-url', + 'type' => 'text', + 'title' => __( 'Twitter', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'linkedin-url', + 'type' => 'text', + 'title' => __( 'LinkedIn', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'myspace-url', + 'type' => 'text', + 'title' => __( 'MySpace', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'gplus-url', + 'type' => 'text', + 'title' => __( 'Google Plus+', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'dribbble-url', + 'type' => 'text', + 'title' => __( 'Dribbble', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'flickr-url', + 'type' => 'text', + 'title' => __( 'Flickr', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'youtube-url', + 'type' => 'text', + 'title' => __( 'You Tube', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'delicious-url', + 'type' => 'text', + 'title' => __( 'Delicious', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'deviantart-url', + 'type' => 'text', + 'title' => __( 'Deviantart', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'rss-url', + 'type' => 'text', + 'title' => __( 'RSS', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'instagram-url', + 'type' => 'text', + 'title' => __( 'Instagram', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'pinterest-url', + 'type' => 'text', + 'title' => __( 'Pinterest', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'vimeo-url', + 'type' => 'text', + 'title' => __( 'Vimeo', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'picassa-url', + 'type' => 'text', + 'title' => __( 'Picassa', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'tumblr-url', + 'type' => 'text', + 'title' => __( 'Tumblr', 'anaglyph-lite' ), + 'validate' => 'url', + 'default' => '' + ), + array( + 'id' => 'email-address', + 'type' => 'text', + 'title' => __( 'E-mail', 'anaglyph-lite' ), + 'validate' => 'email', + 'msg' => 'custom error message', + 'default' => '' + ), + array( + 'id' => 'skype-username', + 'type' => 'text', + 'title' => __( 'Skype', 'anaglyph-lite' ), + 'default' => '' + ), + ) + ); + + include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); global $wpdb; - $contact_form_array = array(); - $contact_form_array[-1] = __('Anaglyph contact form', 'anaglyph-lite'); + $contact_form_array = array(); + $contact_form_array[ - 1 ] = __( 'Anaglyph contact form', 'anaglyph-lite' ); if ( is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) { - - $cf7_forms = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'wpcf7_contact_form' order by post_title"); - if ( !empty($cf7_forms)) { + + $cf7_forms = $wpdb->get_results( "SELECT ID, post_title FROM $wpdb->posts WHERE post_type = 'wpcf7_contact_form' order by post_title" ); + if ( ! empty( $cf7_forms ) ) { foreach ( $cf7_forms as $cform ) { - $contact_form_array[$cform->ID] = $cform->post_title; + $contact_form_array[ $cform->ID ] = $cform->post_title; } - } + } } - + /*Contact Section*/ $arr_section['contact'] = array( - 'title' => __('Contact', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/contact.png', + 'title' => __( 'Contact', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/contact.png', 'icon_type' => 'image', 'fields' => array( array( - 'id' => 'contact-stitle', - 'type' => 'text', - 'title' => __('Contact section title', 'anaglyph-lite'), - 'subtitle' => __('Edit title for contact section', 'anaglyph-lite'), - 'default' => 'Contact us' - ), - array( - 'id' => 'contact-satitle', - 'type' => 'text', - 'title' => __('Contact section additional title', 'anaglyph-lite'), - 'subtitle' => __('Edit additional title for contact section', 'anaglyph-lite'), - 'default' => 'Questions or just wanna say hello? We’re waiting!' - ), - - array( - 'id' => 'contact-scolor', - 'type' => 'color', - 'title' => __('Contact section Background Color', 'anaglyph-lite'), - 'subtitle' => __('Pick a background color for the contact section.', 'anaglyph-lite'), - 'default' => '#181818', - 'validate' => 'color', + 'id' => 'contact-stitle', + 'type' => 'text', + 'title' => __( 'Contact section title', 'anaglyph-lite' ), + 'subtitle' => __( 'Edit title for contact section', 'anaglyph-lite' ), + 'default' => __( 'Contact us', 'anaglyph-lite' ) + ), + array( + 'id' => 'contact-satitle', + 'type' => 'text', + 'title' => __( 'Contact section additional title', 'anaglyph-lite' ), + 'subtitle' => __( 'Edit additional title for contact section', 'anaglyph-lite' ), + 'default' => __( 'Questions or just wanna say hello? We’re waiting!', 'anaglyph-lite' ) + ), + + array( + 'id' => 'contact-scolor', + 'type' => 'color', + 'title' => __( 'Contact section Background Color', 'anaglyph-lite' ), + 'subtitle' => __( 'Pick a background color for the contact section.', 'anaglyph-lite' ), + 'default' => '#181818', + 'validate' => 'color', 'transparent' => false - ), - array( - 'id' => 'contact-simage', - 'type' => 'media', - 'title' => __('Contact section background image', 'anaglyph-lite'), - ), - - array( - 'id' => 'contact-address-icon-color', - 'type' => 'color', - 'title' => __('Contact section address icon color.', 'anaglyph-lite'), - 'default' => '#E23A00', - 'validate' => 'color', + ), + array( + 'id' => 'contact-simage', + 'type' => 'media', + 'title' => __( 'Contact section background image', 'anaglyph-lite' ), + ), + + array( + 'id' => 'contact-address-icon-color', + 'type' => 'color', + 'title' => __( 'Contact section address icon color.', 'anaglyph-lite' ), + 'default' => '#E23A00', + 'validate' => 'color', 'transparent' => false - ), - - array( - 'id' => 'contact-sopacity', - 'type' => 'select', - 'title' => __('Select section opacity', 'anaglyph-lite'), - 'options' => array( - __("opacity-1", "anaglyph-lite") => "opacity-1", - __("opacity-2", "anaglyph-lite") => "opacity-2", - __("opacity-3", "anaglyph-lite") => "opacity-3", - __("opacity-4", "anaglyph-lite") => "opacity-4", - __("opacity-5", "anaglyph-lite") => "opacity-5", - __("opacity-6", "anaglyph-lite") => "opacity-6", - __("opacity-7", "anaglyph-lite") => "opacity-7", - __("opacity-8", "anaglyph-lite") => "opacity-8", - __("opacity-9", "anaglyph-lite") => "opacity-9", - __("opacity-10", "anaglyph-lite") => "opacity-10", - __("opacity-20", "anaglyph-lite") => "opacity-20", - __("opacity-30", "anaglyph-lite") => "opacity-30", - __("opacity-40", "anaglyph-lite") => "opacity-40", - __("opacity-50", "anaglyph-lite") => "opacity-50", - __("opacity-60", "anaglyph-lite") => "opacity-60", - __("opacity-70", "anaglyph-lite") => "opacity-70", - __("opacity-80", "anaglyph-lite") => "opacity-80", - __("opacity-90", "anaglyph-lite") => "opacity-90", - ), - 'default' => 'opacity-7' - ), - array( - 'id' => 'contact-information', - 'type' => 'switch', - 'title' => __('Contact information panel', 'anaglyph-lite'), - 'default' => 0, - 'on' => 'Enabled', - 'off' => 'Disabled', - ), - - array( - 'id' => 'contact-location', - 'type' => 'text', - 'title' => __('Location Name', 'anaglyph-lite'), - 'subtitle' => __('Enter the location name.', 'anaglyph-lite'), - 'default' => '', - 'required' => array('contact-information', '=', '1'), - ), - - array( - 'id' => 'contact-address', - 'type' => 'textarea', - 'title' => __('Location Address', 'anaglyph-lite'), - 'subtitle' => __("Enter your company's address", 'anaglyph-lite'), - 'validate' => 'no_html', - 'default' => '', - 'required' => array('contact-information', '=', '1'), - ), - - array( - 'id' => 'contact-tel', - 'type' => 'text', - 'title' => __('Telephone', 'anaglyph-lite'), - 'subtitle' => __('Enter your telephone number', 'anaglyph-lite'), - 'default' => '', - 'required' => array('contact-information', '=', '1'), - ), - - array( - 'id' => 'contact-fax', - 'type' => 'text', - 'title' => __('Fax', 'anaglyph-lite'), - 'subtitle' => __('Enter your fax number', 'anaglyph-lite'), - 'default' => '', - 'required' => array('contact-information', '=', '1'), - ), - - array( - 'id' => 'contact-skype', - 'type' => 'text', - 'title' => __('Skype', 'anaglyph-lite'), - 'subtitle' => __('Enter your skype number', 'anaglyph-lite'), - 'default' => '', - 'required' => array('contact-information', '=', '1'), - ), - - - array( - 'id' => 'contact-section', - 'type' => 'section', - 'title' => __('Contact form settings', 'anaglyph-lite'), - 'indent' => true, - 'required' => array('contact-information', '=', '1'), - ), - + ), + + array( + 'id' => 'contact-sopacity', + 'type' => 'select', + 'title' => __( 'Select section opacity', 'anaglyph-lite' ), + 'options' => array( + __( "opacity-1", "anaglyph-lite" ) => "opacity-1", + __( "opacity-2", "anaglyph-lite" ) => "opacity-2", + __( "opacity-3", "anaglyph-lite" ) => "opacity-3", + __( "opacity-4", "anaglyph-lite" ) => "opacity-4", + __( "opacity-5", "anaglyph-lite" ) => "opacity-5", + __( "opacity-6", "anaglyph-lite" ) => "opacity-6", + __( "opacity-7", "anaglyph-lite" ) => "opacity-7", + __( "opacity-8", "anaglyph-lite" ) => "opacity-8", + __( "opacity-9", "anaglyph-lite" ) => "opacity-9", + __( "opacity-10", "anaglyph-lite" ) => "opacity-10", + __( "opacity-20", "anaglyph-lite" ) => "opacity-20", + __( "opacity-30", "anaglyph-lite" ) => "opacity-30", + __( "opacity-40", "anaglyph-lite" ) => "opacity-40", + __( "opacity-50", "anaglyph-lite" ) => "opacity-50", + __( "opacity-60", "anaglyph-lite" ) => "opacity-60", + __( "opacity-70", "anaglyph-lite" ) => "opacity-70", + __( "opacity-80", "anaglyph-lite" ) => "opacity-80", + __( "opacity-90", "anaglyph-lite" ) => "opacity-90", + ), + 'default' => 'opacity-7' + ), + array( + 'id' => 'contact-information', + 'type' => 'switch', + 'title' => __( 'Contact information panel', 'anaglyph-lite' ), + 'default' => 0, + 'on' => 'Enabled', + 'off' => 'Disabled', + ), + + array( + 'id' => 'contact-location', + 'type' => 'text', + 'title' => __( 'Location Name', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter the location name.', 'anaglyph-lite' ), + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-address', + 'type' => 'textarea', + 'title' => __( 'Location Address', 'anaglyph-lite' ), + 'subtitle' => __( "Enter your company's address", 'anaglyph-lite' ), + 'validate' => 'no_html', + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-tel', + 'type' => 'text', + 'title' => __( 'Telephone', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter your telephone number', 'anaglyph-lite' ), + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-fax', + 'type' => 'text', + 'title' => __( 'Fax', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter your fax number', 'anaglyph-lite' ), + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-skype', + 'type' => 'text', + 'title' => __( 'Skype', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter your skype number', 'anaglyph-lite' ), + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-add-email', + 'type' => 'text', + 'title' => __( 'E-Mail', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter your E-Mail', 'anaglyph-lite' ), + 'default' => '', + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-section', + 'type' => 'section', + 'title' => __( 'Contact form settings', 'anaglyph-lite' ), + 'indent' => true, + 'required' => array( 'contact-information', '=', '1' ), + ), + array( 'id' => 'contact-section-cform', 'type' => 'select', - 'title' => __('Select contact form', 'anaglyph-lite'), - 'subtitle' => __('select a form from the list to be displayed.', 'anaglyph-lite'), + 'title' => __( 'Select contact form', 'anaglyph-lite' ), + 'subtitle' => __( 'select a form from the list to be displayed.', 'anaglyph-lite' ), 'options' => $contact_form_array, 'default' => '-1', - 'required' => array('contact-information', '=', '1'), - ), - - array( - 'id' => 'contact-email', - 'type' => 'text', - 'title' => __('Contact Form E-Mail', 'anaglyph-lite'), - 'subtitle' => __('Enter your E-mail address to use on the "Contact Form".', 'anaglyph-lite'), - 'validate' => 'email', - 'default' => get_option('admin_email'), - 'required' => array( - array('contact-information', '=', '1'), - array('contact-section-cform', '<', '0'), - ), - ), - - array( - 'id' => 'contact-description', - 'type' => 'text', - 'title' => __('Contact Form description', 'anaglyph-lite'), - 'subtitle' => __('Enter description for "Contact Form".', 'anaglyph-lite'), - 'default' => __('Worried about a SPAM? We are first to hate it!', 'anaglyph-lite'), - 'required' => array( - array('contact-information', '=', '1'), - array('contact-section-cform', '<', '0'), - ), - ), - - array( - 'id' => 'contact-submit', - 'type' => 'text', - 'title' => __('Contact Form submit', 'anaglyph-lite'), - 'subtitle' => __('Enter submit button text for "Contact Form".', 'anaglyph-lite'), - 'default' => __('Send a message', 'anaglyph-lite'), - 'required' => array( - array('contact-information', '=', '1'), - array('contact-section-cform', '<', '0'), - ), - ), - - array( - 'id' => 'contact-form-fields', - 'type' => 'sorter', - 'title' => __('Contact Form Fields', 'anaglyph-lite'), - 'subtitle' => __('Select the order and fields for the contact form.', 'anaglyph-lite'), - 'options' => array( - 'enabled' => array( - 'name' => __('Name','anaglyph-lite'), - 'email' => __('Email','anaglyph-lite'), - 'message' => __('Message', 'anaglyph-lite'), - ), - 'disabled' => array( - 'mob' => __('Mobile', 'anaglyph-lite'), - 'phone' => __('Phone','anaglyph-lite'), - 'captcha' => __('Captcha','anaglyph-lite'), - ), - ), - - 'required' => array( - array('contact-information', '=', '1'), - array('contact-section-cform', '<', '0'), - ), - ), - array( - 'id' => 'contact-animations', - 'type' => 'checkbox', - 'title' => __('Animation', 'anaglyph-lite'), - 'desc' => __('On', 'anaglyph-lite'), - 'class' => 'icheck', - 'default' => '1' - ), - + 'required' => array( 'contact-information', '=', '1' ), + ), + + array( + 'id' => 'contact-email', + 'type' => 'text', + 'title' => __( 'Contact Form E-Mail', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter your E-mail address to use on the "Contact Form".', 'anaglyph-lite' ), + 'validate' => 'email', + 'default' => get_option( 'admin_email' ), + 'required' => array( + array( 'contact-information', '=', '1' ), + array( 'contact-section-cform', '<', '0' ), + ), + ), + + array( + 'id' => 'contact-description', + 'type' => 'text', + 'title' => __( 'Contact Form description', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter description for "Contact Form".', 'anaglyph-lite' ), + 'default' => __( 'Worried about a SPAM? We are first to hate it!', 'anaglyph-lite' ), + 'required' => array( + array( 'contact-information', '=', '1' ), + array( 'contact-section-cform', '<', '0' ), + ), + ), + + array( + 'id' => 'contact-submit', + 'type' => 'text', + 'title' => __( 'Contact Form submit', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter submit button text for "Contact Form".', 'anaglyph-lite' ), + 'default' => __( 'Send a message', 'anaglyph-lite' ), + 'required' => array( + array( 'contact-information', '=', '1' ), + array( 'contact-section-cform', '<', '0' ), + ), + ), + + array( + 'id' => 'contact-form-fields', + 'type' => 'sorter', + 'title' => __( 'Contact Form Fields', 'anaglyph-lite' ), + 'subtitle' => __( 'Select the order and fields for the contact form.', 'anaglyph-lite' ), + 'options' => array( + 'enabled' => array( + 'name' => __( 'Name', 'anaglyph-lite' ), + 'email' => __( 'Email', 'anaglyph-lite' ), + 'message' => __( 'Message', 'anaglyph-lite' ), + ), + 'disabled' => array( + 'mob' => __( 'Mobile', 'anaglyph-lite' ), + 'phone' => __( 'Phone', 'anaglyph-lite' ), + 'captcha' => __( 'Captcha', 'anaglyph-lite' ), + ), + ), + + 'required' => array( + array( 'contact-information', '=', '1' ), + array( 'contact-section-cform', '<', '0' ), + ), + ), + array( + 'id' => 'contact-animations', + 'type' => 'checkbox', + 'title' => __( 'Animation', 'anaglyph-lite' ), + 'desc' => __( 'On', 'anaglyph-lite' ), + 'class' => 'icheck', + 'default' => '1' + ), + ) ); - - + + /*Default Page*/ $arr_section['default-pages'] = array( - 'title' => __('Default pages', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/default-pages.png', + 'title' => __( 'Default pages', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/default-pages.png', 'icon_type' => 'image', 'fields' => array( array( - 'id' => 'simple-post', - 'type' => 'media', - 'title' => __('Single Post header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => 'simple-page', - 'type' => 'media', - 'title' => __('Page header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => 'search-image', - 'type' => 'media', - 'title' => __('Search header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => '404-titleimage', - 'type' => 'media', - 'title' => __('404 header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - array( - 'id' => '404-image', - 'type' => 'media', - 'title' => __('404 logo.', 'anaglyph-lite'), - 'subtitle' => __('Upload a banner for your 404 page.', 'anaglyph-lite'), + 'id' => 'simple-post', + 'type' => 'media', + 'title' => __( 'Single Post header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => 'simple-page', + 'type' => 'media', + 'title' => __( 'Page header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => 'search-image', + 'type' => 'media', + 'title' => __( 'Search header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => '404-titleimage', + 'type' => 'media', + 'title' => __( '404 header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + array( + 'id' => '404-image', + 'type' => 'media', + 'title' => __( '404 logo.', 'anaglyph-lite' ), + 'subtitle' => __( 'Upload a banner for your 404 page.', 'anaglyph-lite' ), //'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - array( - 'id' => '404-text', - 'type' => 'textarea', - 'title' => __('404 page text.', 'anaglyph-lite'), - 'subtitle' => __('Enter the text you want to show in your 404 page here.', 'anaglyph-lite'), - 'default' => __('It looks like nothing was found at this location. Maybe try a search?', 'anaglyph-lite') - ), - - array( - 'id' => 'category-image', - 'type' => 'media', - 'title' => __('Category header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => 'archive-image', - 'type' => 'media', - 'title' => __('Archive header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => 'author-image', - 'type' => 'media', - 'title' => __('Author archive header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - - array( - 'id' => 'tag-image', - 'type' => 'media', - 'title' => __('Tag archive header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), - ), - + ), + array( + 'id' => '404-text', + 'type' => 'textarea', + 'title' => __( '404 page text.', 'anaglyph-lite' ), + 'subtitle' => __( 'Enter the text you want to show in your 404 page here.', 'anaglyph-lite' ), + 'default' => __( 'It looks like nothing was found at this location. Maybe try a search?', 'anaglyph-lite' ) + ), + + array( + 'id' => 'category-image', + 'type' => 'media', + 'title' => __( 'Category header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => 'archive-image', + 'type' => 'media', + 'title' => __( 'Archive header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => 'author-image', + 'type' => 'media', + 'title' => __( 'Author archive header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + + array( + 'id' => 'tag-image', + 'type' => 'media', + 'title' => __( 'Tag archive header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), + ), + ) - ); - - + ); + + /*Footer Section*/ $arr_section['footer'] = array( - 'title' => __('Footer', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/footer.png', + 'title' => __( 'Footer', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/footer.png', 'icon_type' => 'image', 'fields' => array( array( - 'id' => 'footer-text', - 'type' => 'editor', - 'title' => __('Copyright section', 'anaglyph-lite'), - 'subtitle' => __('Replace default theme copyright information and links', 'anaglyph-lite'), - 'default' => '© Fruitful Code, Powered by WordPress', - ), - array( - 'id' => 'footer-color', - 'type' => 'color', - 'title' => __('Footer Background Color', 'anaglyph-lite'), - 'subtitle' => __('Pick a background color for the footer.', 'anaglyph-lite'), - 'default' => '#181818', - 'validate' => 'color', + 'id' => 'footer-text', + 'type' => 'editor', + 'title' => __( 'Copyright section', 'anaglyph-lite' ), + 'subtitle' => __( 'Replace default theme copyright information and links', 'anaglyph-lite' ), + 'default' => '© Fruitful Code, Powered by WordPress', + ), + array( + 'id' => 'footer-color', + 'type' => 'color', + 'title' => __( 'Footer Background Color', 'anaglyph-lite' ), + 'subtitle' => __( 'Pick a background color for the footer.', 'anaglyph-lite' ), + 'default' => '#181818', + 'validate' => 'color', 'transparent' => false - ), - array( - 'id' => 'footer-image', - 'type' => 'media', - 'title' => __('Footer background image', 'anaglyph-lite'), - ), - array( - 'id' => 'opacity-fsection', - 'type' => 'select', - 'title' => __('Select section opacity', 'anaglyph-lite'), - 'options' => array( - __("opacity-1", "anaglyph-lite") => "opacity-1", - __("opacity-2", "anaglyph-lite") => "opacity-2", - __("opacity-3", "anaglyph-lite") => "opacity-3", - __("opacity-4", "anaglyph-lite") => "opacity-4", - __("opacity-5", "anaglyph-lite") => "opacity-5", - __("opacity-6", "anaglyph-lite") => "opacity-6", - __("opacity-7", "anaglyph-lite") => "opacity-7", - __("opacity-8", "anaglyph-lite") => "opacity-8", - __("opacity-9", "anaglyph-lite") => "opacity-9", - __("opacity-10", "anaglyph-lite") => "opacity-10", - __("opacity-20", "anaglyph-lite") => "opacity-20", - __("opacity-30", "anaglyph-lite") => "opacity-30", - __("opacity-40", "anaglyph-lite") => "opacity-40", - __("opacity-50", "anaglyph-lite") => "opacity-50", - __("opacity-60", "anaglyph-lite") => "opacity-60", - __("opacity-70", "anaglyph-lite") => "opacity-70", - __("opacity-80", "anaglyph-lite") => "opacity-80", - __("opacity-90", "anaglyph-lite") => "opacity-90", - ), - 'default' => 'opacity-7' - ), - array( - 'id' => 'footer-issocial', - 'type' => 'checkbox', - 'title' => __('Social icons', 'anaglyph-lite'), - 'desc' => __('Enable social icons.', 'anaglyph-lite'), - 'default' => '1', - 'class' => 'icheck', - ), - array( - 'id' => 'footer-iscontact', - 'type' => 'checkbox', - 'title' => __('See the contact information in the footer', 'anaglyph-lite'), - 'desc' => __('Enable contact information', 'anaglyph-lite'), - 'default' => '1', - 'class' => 'icheck', - ), - array( - 'id' => 'footer-typography', - 'type' => 'typography', - 'title' => __('Footer Font Style.', 'anaglyph-lite'), - 'google' => true, - 'subsets' => false, - 'font-backup' => false, - 'line-height' => false, - 'text-align' => false, - 'subsets' => true, - 'output' => array('footer#page-footer, footer#page-footer p'), - 'units' =>'px', - 'subtitle' => __('Select typography for footer.', 'anaglyph-lite'), - 'default' => array( - 'color' => '#fff', - 'font-style' => '400', - 'font-family' => 'Montserrat', - 'google' => true, - 'font-size' => '14px', - ), - 'preview' => array('text' => 'sample text'), - ), - - + ), + array( + 'id' => 'footer-image', + 'type' => 'media', + 'title' => __( 'Footer background image', 'anaglyph-lite' ), + ), + array( + 'id' => 'opacity-fsection', + 'type' => 'select', + 'title' => __( 'Select section opacity', 'anaglyph-lite' ), + 'options' => array( + __( "opacity-1", "anaglyph-lite" ) => "opacity-1", + __( "opacity-2", "anaglyph-lite" ) => "opacity-2", + __( "opacity-3", "anaglyph-lite" ) => "opacity-3", + __( "opacity-4", "anaglyph-lite" ) => "opacity-4", + __( "opacity-5", "anaglyph-lite" ) => "opacity-5", + __( "opacity-6", "anaglyph-lite" ) => "opacity-6", + __( "opacity-7", "anaglyph-lite" ) => "opacity-7", + __( "opacity-8", "anaglyph-lite" ) => "opacity-8", + __( "opacity-9", "anaglyph-lite" ) => "opacity-9", + __( "opacity-10", "anaglyph-lite" ) => "opacity-10", + __( "opacity-20", "anaglyph-lite" ) => "opacity-20", + __( "opacity-30", "anaglyph-lite" ) => "opacity-30", + __( "opacity-40", "anaglyph-lite" ) => "opacity-40", + __( "opacity-50", "anaglyph-lite" ) => "opacity-50", + __( "opacity-60", "anaglyph-lite" ) => "opacity-60", + __( "opacity-70", "anaglyph-lite" ) => "opacity-70", + __( "opacity-80", "anaglyph-lite" ) => "opacity-80", + __( "opacity-90", "anaglyph-lite" ) => "opacity-90", + ), + 'default' => 'opacity-7' + ), + array( + 'id' => 'footer-issocial', + 'type' => 'checkbox', + 'title' => __( 'Social icons', 'anaglyph-lite' ), + 'desc' => __( 'Enable social icons.', 'anaglyph-lite' ), + 'default' => '1', + 'class' => 'icheck', + ), + array( + 'id' => 'footer-iscontact', + 'type' => 'checkbox', + 'title' => __( 'See the contact information in the footer', 'anaglyph-lite' ), + 'desc' => __( 'Enable contact information', 'anaglyph-lite' ), + 'default' => '1', + 'class' => 'icheck', + ), + array( + 'id' => 'footer-typography', + 'type' => 'typography', + 'title' => __( 'Footer Font Style.', 'anaglyph-lite' ), + 'google' => true, + 'subsets' => false, + 'font-backup' => false, + 'line-height' => false, + 'text-align' => false, + 'subsets' => true, + 'output' => array( 'footer#page-footer, footer#page-footer p' ), + 'units' => 'px', + 'subtitle' => __( 'Select typography for footer.', 'anaglyph-lite' ), + 'default' => array( + 'color' => '#fff', + 'font-style' => '400', + 'font-family' => 'Montserrat', + 'google' => true, + 'font-size' => '14px', + ), + 'preview' => array( 'text' => 'sample text' ), + ), + + ) ); - - + + /*Custom Section*/ $arr_section['custom'] = array( - 'title' => __('Custom Code', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/custom-code.png', + 'title' => __( 'Custom Code', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/custom-code.png', 'icon_type' => 'image', - 'fields' => array ( - array( - 'id' => 'custom-css', - 'type' => 'ace_editor', - 'title' => __('CSS Code', 'anaglyph-lite'), - 'subtitle' => __('Paste your CSS code here.', 'anaglyph-lite'), - 'mode' => 'css', - 'theme' => 'chrome', - 'desc' => '', - 'default' => "" - ), - array( - 'id' => 'custom-js', - 'type' => 'ace_editor', - 'title' => __('JS Code', 'anaglyph-lite'), - 'subtitle' => __('Paste your JS code here.', 'anaglyph-lite'), - 'mode' => 'javascript', - 'theme' => 'chrome', - 'desc' => '', - 'default' => "" - ), + 'fields' => array( + array( + 'id' => 'custom-css', + 'type' => 'ace_editor', + 'title' => __( 'CSS Code', 'anaglyph-lite' ), + 'subtitle' => __( 'Paste your CSS code here.', 'anaglyph-lite' ), + 'mode' => 'css', + 'theme' => 'chrome', + 'desc' => '', + 'default' => "" + ), + array( + 'id' => 'custom-js', + 'type' => 'ace_editor', + 'title' => __( 'JS Code', 'anaglyph-lite' ), + 'subtitle' => __( 'Paste your JS code here.', 'anaglyph-lite' ), + 'mode' => 'javascript', + 'theme' => 'chrome', + 'desc' => '', + 'default' => "" + ), ) ); - + if ( class_exists( 'woocommerce' ) ) { /*WooCommerce options*/ $arr_section['woocommerce'] = array( - 'title' => __('WooCommerce', 'anaglyph-lite'), + 'title' => __( 'WooCommerce', 'anaglyph-lite' ), 'icon' => $sample_patterns_url . 'images/icons/woo.png', 'icon_type' => 'image', - 'fields' => array ( + 'fields' => array( array( - 'id' => 'shopheader-image', - 'type' => 'media', - 'title' => __('Shop header image.', 'anaglyph-lite'), - 'default' => array('url' => esc_url(get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg')), + 'id' => 'shopheader-image', + 'type' => 'media', + 'title' => __( 'Shop header image.', 'anaglyph-lite' ), + 'default' => array( 'url' => esc_url( get_template_directory_uri() . '/includes/theme/assets/bgs/title-background.jpg' ) ), ), - + array( - 'id' => 'shop-layout', - 'type' => 'image_select', - 'title' => __('Shop layout', 'anaglyph-lite'), - 'subtitle' => __('Select main content and sidebar alignment.', 'anaglyph-lite'), - 'options' => array( - '1' => array('alt' => '1 Column', 'img' => ReduxFramework::$_url . 'assets/img/1col.png'), - '2' => array('alt' => '2 Column Left', 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'), - '3' => array('alt' => '2 Column Right', 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'), + 'id' => 'shop-layout', + 'type' => 'image_select', + 'title' => __( 'Shop layout', 'anaglyph-lite' ), + 'subtitle' => __( 'Select main content and sidebar alignment.', 'anaglyph-lite' ), + 'options' => array( + '1' => array( + 'alt' => '1 Column', + 'img' => ReduxFramework::$_url . 'assets/img/1col.png' + ), + '2' => array( + 'alt' => '2 Column Left', + 'img' => ReduxFramework::$_url . 'assets/img/2cl.png' + ), + '3' => array( + 'alt' => '2 Column Right', + 'img' => ReduxFramework::$_url . 'assets/img/2cr.png' + ), ), - 'default' => '1' + 'default' => '1' ), - + array( - 'id' => 'shop-product-perpage', - 'type' => 'text', - 'title' => __('Products per page', 'anaglyph-lite'), - 'subtitle' => __('Change number of products displayed per page.', 'anaglyph-lite'), - 'validate' => 'numeric', - 'default' => '12', + 'id' => 'shop-product-perpage', + 'type' => 'text', + 'title' => __( 'Products per page', 'anaglyph-lite' ), + 'subtitle' => __( 'Change number of products displayed per page.', 'anaglyph-lite' ), + 'validate' => 'numeric', + 'default' => '12', ), - - + + array( - 'id' => 'shop-product-perrow', - 'type' => 'select', - 'title' => __('Products per row', 'anaglyph-lite'), - 'subtitle' => __('Change number of products per row.', 'anaglyph-lite'), - 'options' => array( - '2' => __('2 Columns', 'anaglyph-lite'), - '3' => __('3 Columns', 'anaglyph-lite'), - '4' => __('4 Columns', 'anaglyph-lite'), + 'id' => 'shop-product-perrow', + 'type' => 'select', + 'title' => __( 'Products per row', 'anaglyph-lite' ), + 'subtitle' => __( 'Change number of products per row.', 'anaglyph-lite' ), + 'options' => array( + '2' => __( '2 Columns', 'anaglyph-lite' ), + '3' => __( '3 Columns', 'anaglyph-lite' ), + '4' => __( '4 Columns', 'anaglyph-lite' ), ), - 'default' => '4' + 'default' => '4' ), - + array( - 'id' => 'shop-animations', - 'type' => 'select', - 'title' => __('Select animation for products.', 'anaglyph-lite'), - 'options' => array( - 'top' => __("Top", "anaglyph-lite"), - 'left' => __("Left", "anaglyph-lite"), - 'right' => __("Right", "anaglyph-lite"), - 'bottom' => __("Bottom", "anaglyph-lite"), - 'none' => __("None", "anaglyph-lite"), + 'id' => 'shop-animations', + 'type' => 'select', + 'title' => __( 'Select animation for products.', 'anaglyph-lite' ), + 'options' => array( + 'top' => __( "Top", "anaglyph-lite" ), + 'left' => __( "Left", "anaglyph-lite" ), + 'right' => __( "Right", "anaglyph-lite" ), + 'bottom' => __( "Bottom", "anaglyph-lite" ), + 'none' => __( "None", "anaglyph-lite" ), ), - 'default' => 'bottom' + 'default' => 'bottom' ), - + ) ); - } - - $arr_section['import-export'] = array( - 'title' => __('Import / Export', 'anaglyph-lite'), - 'desc' => __('Import and Export your anaglyph Framework settings from file, text or URL.', 'anaglyph-lite'), - 'icon' => $sample_patterns_url . 'images/icons/import-export.png', + } + + $arr_section['import-export'] = array( + 'title' => __( 'Import / Export', 'anaglyph-lite' ), + 'desc' => __( 'Import and Export your anaglyph Framework settings from file, text or URL.', 'anaglyph-lite' ), + 'icon' => $sample_patterns_url . 'images/icons/import-export.png', 'icon_type' => 'image', - 'fields' => array( - array( - 'id' => 'opt-import-export', - 'type' => 'import_export', - 'title' => 'Import Export', - 'subtitle' => 'Save and restore your anaglyph options', - 'full_width' => false, - ), - ), - ); - - $fields = apply_filters( 'anaglyph_admin_fields', $arr_section); + 'fields' => array( + array( + 'id' => 'opt-import-export', + 'type' => 'import_export', + 'title' => __( 'Import Export', 'anaglyph-lite' ), + 'subtitle' => 'Save and restore your anaglyph options', + 'full_width' => false, + ), + ), + ); + + $fields = apply_filters( 'anaglyph_admin_fields', $arr_section ); $this->sections = $fields; - } + } - public function setHelpTabs() {} + public function setHelpTabs() { + } - public function setArguments() { + public function setArguments() { $source_path = get_template_directory_uri() . '/includes/admin/anaglyph-options/patterns/'; - - $this->args = array( - // TYPICAL -> Change these values as you need/desire - 'opt_name' => 'anaglyph_config', // This is where your data is stored in the database and also becomes your global variable name. - 'display_name' => $this->theme->get('Name'), // Name that appears at the top of your panel - 'display_version' => $this->theme->get('Version'), // Version that appears at the top of your panel - 'menu_type' => 'menu', // Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only) - 'allow_sub_menu' => false, // Show the sections below the admin menu item or not - 'menu_title' => __('Anaglyph options', 'anaglyph-lite'), - 'page_title' => __('Anaglyph options', 'anaglyph-lite'), - - // You will need to generate a Google API key to use this feature. - // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth - 'google_api_key' => '861074126314', // Must be defined to add google fonts to the typography module + + $this->args = array( + // TYPICAL -> Change these values as you need/desire + 'opt_name' => 'anaglyph_config', + // This is where your data is stored in the database and also becomes your global variable name. + 'display_name' => $this->theme->get( 'Name' ), + // Name that appears at the top of your panel + 'display_version' => $this->theme->get( 'Version' ), + // Version that appears at the top of your panel + 'menu_type' => 'menu', + // Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only) + 'allow_sub_menu' => false, + // Show the sections below the admin menu item or not + 'menu_title' => __( 'Anaglyph options', 'anaglyph-lite' ), + 'page_title' => __( 'Anaglyph options', 'anaglyph-lite' ), + + // You will need to generate a Google API key to use this feature. + // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth + 'google_api_key' => '861074126314', + // Must be defined to add google fonts to the typography module 'google_update_weekly' => false, - - 'async_typography' => false, // Use a asynchronous font on the front end or font string - 'admin_bar' => true, // Show the panel pages on the admin bar - 'global_variable' => 'anaglyph_config', // Set a different name for your global variable other than the opt_name - 'dev_mode' => false, // Show the time the page took to load, etc - 'customizer' => false, // Enable basic customizer support - - // OPTIONAL -> Give you extra features - 'page_priority' => null, // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. - 'page_permissions' => 'manage_options', // Permissions needed to access the options panel. - 'menu_icon' => $source_path . 'anaglyph-icon.png', // Specify a custom URL to an icon - 'last_tab' => '', // Force your panel to always open to a specific tab (by id) - 'page_icon' => 'anaglyph-icon', // Icon displayed in the admin panel next to your menu_title - 'page_slug' => 'anaglyph_options', // Page slug used to denote the panel - 'save_defaults' => true, // On load save the defaults to DB before user clicks save or not - 'default_show' => false, // If true, shows the default value next to each field that is not the default value. - 'default_mark' => '*', // What to print by the field's title if the value shown is default. Suggested: * - 'show_import_export' => false, // Shows the Import/Export panel when not used as a field. - - // CAREFUL -> These options are for advanced use only - 'transient_time' => 60 * MINUTE_IN_SECONDS, - 'output' => true, // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output - 'output_tag' => true, // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head - 'footer_credit' => '' . __( 'Anaglyph Options panel created using "Reduxe Framework".', 'anaglyph-lite' ). '', // Disable the footer credit of anaglyph. Please leave if you can help it. - - // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. - 'database' => '', // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! - 'system_info' => false, // REMOVE - 'page_type' => 'submenu', - - // HINTS - 'hints' => array( - 'icon' => 'icon-question-sign', - 'icon_position' => 'right', - 'icon_color' => 'lightgray', - 'icon_size' => 'normal', - 'tip_style' => array( - 'color' => 'light', - 'shadow' => true, - 'rounded' => false, - 'style' => '', - ), - 'tip_position' => array( - 'my' => 'top left', - 'at' => 'bottom right', - ), - 'tip_effect' => array( - 'show' => array( - 'effect' => 'slide', - 'duration' => '500', - 'event' => 'mouseover', - ), - 'hide' => array( - 'effect' => 'slide', - 'duration' => '500', - 'event' => 'click mouseleave', - ), - ), - ) - ); - - - // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons. - $this->args['share_icons'][] = array( - 'url' => 'https://github.com/Fruitfulcode', - 'title' => 'Visit us on GitHub', - 'img' => esc_url($source_path . 'images/icons/github.png'), - ); - $this->args['share_icons'][] = array( - 'url' => 'https://www.facebook.com/fruitfulc0de', - 'title' => 'Like us on Facebook', - 'img' => esc_url($source_path . 'images/icons/facebook.png'), - ); - $this->args['share_icons'][] = array( - 'url' => 'https://twitter.com/fruitfulcode', - 'title' => 'Follow us on Twitter', - 'img' => esc_url($source_path . 'images/icons/twitter.png'), - ); - - - // Panel Intro text -> before the form - if (!isset($this->args['global_variable']) || $this->args['global_variable'] !== false) { - if (!empty($this->args['global_variable'])) { - $v = $this->args['global_variable']; - } else { - $v = str_replace('-', '_', $this->args['opt_name']); - } - $this->args['intro_text'] = ''; - //sprintf(__('', 'anaglyph-lite'), $v); - } else { - $this->args['intro_text'] = ''; - } - - // Add content after the form. - $this->args['footer_text'] = ''; + + 'async_typography' => false, + // Use a asynchronous font on the front end or font string + 'admin_bar' => true, + // Show the panel pages on the admin bar + 'global_variable' => 'anaglyph_config', + // Set a different name for your global variable other than the opt_name + 'dev_mode' => false, + // Show the time the page took to load, etc + 'customizer' => false, + // Enable basic customizer support + + // OPTIONAL -> Give you extra features + 'page_priority' => null, + // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. + 'page_permissions' => 'manage_options', + // Permissions needed to access the options panel. + 'menu_icon' => $source_path . 'anaglyph-icon.png', + // Specify a custom URL to an icon + 'last_tab' => '', + // Force your panel to always open to a specific tab (by id) + 'page_icon' => 'anaglyph-icon', + // Icon displayed in the admin panel next to your menu_title + 'page_slug' => 'anaglyph_options', + // Page slug used to denote the panel + 'save_defaults' => true, + // On load save the defaults to DB before user clicks save or not + 'default_show' => false, + // If true, shows the default value next to each field that is not the default value. + 'default_mark' => '*', + // What to print by the field's title if the value shown is default. Suggested: * + 'show_import_export' => false, + // Shows the Import/Export panel when not used as a field. + + // CAREFUL -> These options are for advanced use only + 'transient_time' => 60 * MINUTE_IN_SECONDS, + 'output' => true, + // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output + 'output_tag' => true, + // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head + 'footer_credit' => '' . __( 'Anaglyph Options panel created using "Reduxe Framework".', 'anaglyph-lite' ) . '', + // Disable the footer credit of anaglyph. Please leave if you can help it. + + // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. + 'database' => '', + // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! + 'system_info' => false, + // REMOVE + 'page_type' => 'submenu', + + // HINTS + 'hints' => array( + 'icon' => 'icon-question-sign', + 'icon_position' => 'right', + 'icon_color' => 'lightgray', + 'icon_size' => 'normal', + 'tip_style' => array( + 'color' => 'light', + 'shadow' => true, + 'rounded' => false, + 'style' => '', + ), + 'tip_position' => array( + 'my' => 'top left', + 'at' => 'bottom right', + ), + 'tip_effect' => array( + 'show' => array( + 'effect' => 'slide', + 'duration' => '500', + 'event' => 'mouseover', + ), + 'hide' => array( + 'effect' => 'slide', + 'duration' => '500', + 'event' => 'click mouseleave', + ), + ), + ) + ); + + + // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons. + $this->args['share_icons'][] = array( + 'url' => 'https://github.com/Fruitfulcode', + 'title' => __( 'Visit us on GitHub', 'anaglyph-lite' ), + 'img' => esc_url( $source_path . 'images/icons/github.png' ), + ); + $this->args['share_icons'][] = array( + 'url' => 'https://www.facebook.com/fruitfulc0de', + 'title' => __( 'Like us on Facebook', 'anaglyph-lite' ), + 'img' => esc_url( $source_path . 'images/icons/facebook.png' ), + ); + $this->args['share_icons'][] = array( + 'url' => 'https://twitter.com/fruitfulcode', + 'title' => __( 'Follow us on Twitter', 'anaglyph-lite' ), + 'img' => esc_url( $source_path . 'images/icons/twitter.png' ), + ); + + + // Panel Intro text -> before the form + if ( ! isset( $this->args['global_variable'] ) || $this->args['global_variable'] !== false ) { + if ( ! empty( $this->args['global_variable'] ) ) { + $v = $this->args['global_variable']; + } else { + $v = str_replace( '-', '_', $this->args['opt_name'] ); + } + $this->args['intro_text'] = ''; + //sprintf(__('', 'anaglyph-lite'), $v); + } else { + $this->args['intro_text'] = ''; + } + + // Add content after the form. + $this->args['footer_text'] = ''; } } } global $anaglyphConfig; - $anaglyphConfig = new anaglyph_config(); +$anaglyphConfig = new anaglyph_config(); diff --git a/includes/admin/libs/metaboxes/init.php b/includes/admin/libs/metaboxes/init.php index 7f63749..0a66980 100644 --- a/includes/admin/libs/metaboxes/init.php +++ b/includes/admin/libs/metaboxes/init.php @@ -282,11 +282,11 @@ public function register_scripts() { 'script_debug' => defined('SCRIPT_DEBUG') && SCRIPT_DEBUG, 'new_admin_style' => version_compare( $wp_version, '3.7', '>' ), 'object_type' => self::get_object_type(), - 'upload_file' => 'Use this file', - 'remove_image' => 'Remove Image', - 'remove_file' => 'Remove', - 'file' => 'File:', - 'download' => 'Download', + 'upload_file' => __('Use this file', 'anaglyph-lite'), + 'remove_image' => __('Remove Image', 'anaglyph-lite'), + 'remove_file' => __('Remove', 'anaglyph-lite'), + 'file' => __('File:', 'anaglyph-lite'), + 'download' => __('Download', 'anaglyph-lite'), 'ajaxurl' => admin_url( '/admin-ajax.php' ), 'up_arrow' => '', 'down_arrow' => '', @@ -753,7 +753,7 @@ public static function set_mb_type( $meta_box ) { elseif ( is_string( $meta_box['pages'] ) ) $type = $meta_box['pages']; // if it's an array of one, extract it - elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] === 1 ) ) + elseif ( is_array( $meta_box['pages'] ) && count( $meta_box['pages'] ) === 1 ) $type = is_string( end( $meta_box['pages'] ) ) ? end( $meta_box['pages'] ) : false; if ( !$type ) diff --git a/includes/admin/libs/tgm/class-tgm-plugin-activation.php b/includes/admin/libs/tgm/class-tgm-plugin-activation.php index 90f731e..213072b 100644 --- a/includes/admin/libs/tgm/class-tgm-plugin-activation.php +++ b/includes/admin/libs/tgm/class-tgm-plugin-activation.php @@ -8,22 +8,11 @@ * or theme author for support. * * @package TGM-Plugin-Activation - * @version 2.5.2 + * @version 2.6.1 for parent theme Anaglyph Lite for publication on WordPress.org * @link http://tgmpluginactivation.com/ * @author Thomas Griffin, Gary Jones, Juliette Reinders Folmer * @copyright Copyright (c) 2011, Thomas Griffin * @license GPL-2.0+ - * - * @wordpress-plugin - * Plugin Name: TGM Plugin Activation - * Plugin URI: - * Description: Plugin installation and activation for WordPress themes. - * Version: 2.5.2 - * Author: Thomas Griffin, Gary Jones, Juliette Reinders Folmer - * Author URI: http://tgmpluginactivation.com/ - * Text Domain: anaglyph-lite - * Domain Path: /languages/ - * Copyright: 2011, Thomas Griffin */ /* @@ -45,1911 +34,2028 @@ if ( ! class_exists( 'TGM_Plugin_Activation' ) ) { - /** - * Automatic plugin installation and activation library. - * - * Creates a way to automatically install and activate plugins from within themes. - * The plugins can be either bundled, downloaded from the WordPress - * Plugin Repository or downloaded from another external source. - * - * @since 1.0.0 - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGM_Plugin_Activation { - /** - * TGMPA version number. - * - * @since 2.5.0 - * - * @const string Version number. - */ - const TGMPA_VERSION = '2.5.2'; - - /** - * Regular expression to test if a URL is a WP plugin repo URL. - * - * @const string Regex. - * - * @since 2.5.0 - */ - const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|'; - - /** - * Arbitrary regular expression to test if a string starts with a URL. - * - * @const string Regex. - * - * @since 2.5.0 - */ - const IS_URL_REGEX = '|^http[s]?://|'; - - /** - * Holds a copy of itself, so it can be referenced by the class name. - * - * @since 1.0.0 - * - * @var TGM_Plugin_Activation - */ - public static $instance; - - /** - * Holds arrays of plugin details. - * - * @since 1.0.0 - * - * @since 2.5.0 the array has the plugin slug as an associative key. - * - * @var array - */ - public $plugins = array(); - - /** - * Holds arrays of plugin names to use to sort the plugins array. - * - * @since 2.5.0 - * - * @var array - */ - protected $sort_order = array(); - - /** - * Whether any plugins have the 'force_activation' setting set to true. - * - * @since 2.5.0 - * - * @var bool - */ - protected $has_forced_activation = false; - - /** - * Whether any plugins have the 'force_deactivation' setting set to true. - * - * @since 2.5.0 - * - * @var bool - */ - protected $has_forced_deactivation = false; - - /** - * Name of the unique ID to hash notices. - * - * @since 2.4.0 - * - * @var string - */ - public $id = 'tgmpa'; - - /** - * Name of the query-string argument for the admin page. - * - * @since 1.0.0 - * - * @var string - */ - protected $menu = 'tgmpa-install-plugins'; - - /** - * Parent menu file slug. - * - * @since 2.5.0 - * - * @var string - */ - public $parent_slug = 'themes.php'; - - /** - * Capability needed to view the plugin installation menu item. - * - * @since 2.5.0 - * - * @var string - */ - public $capability = 'edit_theme_options'; - - /** - * Default absolute path to folder containing bundled plugin zip files. - * - * @since 2.0.0 - * - * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string. - */ - public $default_path = ''; - - /** - * Flag to show admin notices or not. - * - * @since 2.1.0 - * - * @var boolean - */ - public $has_notices = true; - - /** - * Flag to determine if the user can dismiss the notice nag. - * - * @since 2.4.0 - * - * @var boolean - */ - public $dismissable = true; - - /** - * Message to be output above nag notice if dismissable is false. - * - * @since 2.4.0 - * - * @var string - */ - public $dismiss_msg = ''; - - /** - * Flag to set automatic activation of plugins. Off by default. - * - * @since 2.2.0 - * - * @var boolean - */ - public $is_automatic = false; - - /** - * Optional message to display before the plugins table. - * - * @since 2.2.0 - * - * @var string Message filtered by wp_kses_post(). Default is empty string. - */ - public $message = ''; - - /** - * Holds configurable array of strings. - * - * Default values are added in the constructor. - * - * @since 2.0.0 - * - * @var array - */ - public $strings = array(); - - /** - * Holds the version of WordPress. - * - * @since 2.4.0 - * - * @var int - */ - public $wp_version; - - /** - * Holds the hook name for the admin page. - * - * @since 2.5.0 - * - * @var string - */ - public $page_hook; - - /** - * Adds a reference of this object to $instance, populates default strings, - * does the tgmpa_init action hook, and hooks in the interactions to init. - * - * @internal This method should be `protected`, but as too many TGMPA implementations - * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues. - * Reverted back to public for the time being. - * - * @since 1.0.0 - * - * @see TGM_Plugin_Activation::init() - */ - public function __construct() { - // Set the current WordPress version. - $this->wp_version = $GLOBALS['wp_version']; - - // Announce that the class is ready, and pass the object (for advanced use). - do_action_ref_array( 'tgmpa_init', array( $this ) ); - - // When the rest of WP has loaded, kick-start the rest of the class. - add_action( 'init', array( $this, 'init' ) ); - } - - /** - * Magic method to (not) set protected properties from outside of this class. - * - * @internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property - * is being assigned rather than tested in a conditional, effectively rendering it useless. - * This 'hack' prevents this from happening. - * - * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 - * - * @param string $name Name of an inaccessible property. - * @param mixed $value Value to assign to the property. - * @return void Silently fail to set the property when this is tried from outside of this class context. - * (Inside this class context, the __set() method if not used as there is direct access.) - */ - public function __set( $name, $value ) { - return; - } - - /** - * Magic method to get the value of a protected property outside of this class context. - * - * @param string $name Name of an inaccessible property. - * @return mixed The property value. - */ - public function __get( $name ) { - return $this->{$name}; - } - - /** - * Initialise the interactions between this class and WordPress. - * - * Hooks in three new methods for the class: admin_menu, notices and styles. - * - * @since 2.0.0 - * - * @see TGM_Plugin_Activation::admin_menu() - * @see TGM_Plugin_Activation::notices() - * @see TGM_Plugin_Activation::styles() - */ - public function init() { - /** - * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter - * you can overrule that behaviour. - * - * @since 2.5.0 - * - * @param bool $load Whether or not TGMPA should load. - * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. - */ - if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { - return; - } - - // Load class strings. - $this->strings = array( - 'page_title' => __( 'Install Required Plugins', 'anaglyph-lite' ), - 'menu_title' => __( 'Install Plugins', 'anaglyph-lite' ), - 'installing' => __( 'Installing Plugin: %s', 'anaglyph-lite' ), - 'oops' => __( 'Something went wrong with the plugin API.', 'anaglyph-lite' ), - 'notice_can_install_required' => _n_noop( - 'This theme requires the following plugin: %1$s.', - 'This theme requires the following plugins: %1$s.', - 'anaglyph-lite' - ), - 'notice_can_install_recommended' => _n_noop( - 'This theme recommends the following plugin: %1$s.', - 'This theme recommends the following plugins: %1$s.', - 'anaglyph-lite' - ), - 'notice_cannot_install' => _n_noop( - 'Sorry, but you do not have the correct permissions to install the %1$s plugin.', - 'Sorry, but you do not have the correct permissions to install the %1$s plugins.', - 'anaglyph-lite' - ), - 'notice_ask_to_update' => _n_noop( - 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', - 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', - 'anaglyph-lite' - ), - 'notice_ask_to_update_maybe' => _n_noop( - 'There is an update available for: %1$s.', - 'There are updates available for the following plugins: %1$s.', - 'anaglyph-lite' - ), - 'notice_cannot_update' => _n_noop( - 'Sorry, but you do not have the correct permissions to update the %1$s plugin.', - 'Sorry, but you do not have the correct permissions to update the %1$s plugins.', - 'anaglyph-lite' - ), - 'notice_can_activate_required' => _n_noop( - 'The following required plugin is currently inactive: %1$s.', - 'The following required plugins are currently inactive: %1$s.', - 'anaglyph-lite' - ), - 'notice_can_activate_recommended' => _n_noop( - 'The following recommended plugin is currently inactive: %1$s.', - 'The following recommended plugins are currently inactive: %1$s.', - 'anaglyph-lite' - ), - 'notice_cannot_activate' => _n_noop( - 'Sorry, but you do not have the correct permissions to activate the %1$s plugin.', - 'Sorry, but you do not have the correct permissions to activate the %1$s plugins.', - 'anaglyph-lite' - ), - 'install_link' => _n_noop( - 'Begin installing plugin', - 'Begin installing plugins', - 'anaglyph-lite' - ), - 'update_link' => _n_noop( - 'Begin updating plugin', - 'Begin updating plugins', - 'anaglyph-lite' - ), - 'activate_link' => _n_noop( - 'Begin activating plugin', - 'Begin activating plugins', - 'anaglyph-lite' - ), - 'return' => __( 'Return to Required Plugins Installer', 'anaglyph-lite' ), - 'dashboard' => __( 'Return to the dashboard', 'anaglyph-lite' ), - 'plugin_activated' => __( 'Plugin activated successfully.', 'anaglyph-lite' ), - 'activated_successfully' => __( 'The following plugin was activated successfully:', 'anaglyph-lite' ), - 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'anaglyph-lite' ), - 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'anaglyph-lite' ), - 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'anaglyph-lite' ), - 'dismiss' => __( 'Dismiss this notice', 'anaglyph-lite' ), - 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'anaglyph-lite' ), - ); - - do_action( 'tgmpa_register' ); - - /* After this point, the plugins should be registered and the configuration set. */ - - // Proceed only if we have plugins to handle. - if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { - return; - } - - // Set up the menu and notices if we still have outstanding actions. - if ( true !== $this->is_tgmpa_complete() ) { - // Sort the plugins. - array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); - - add_action( 'admin_menu', array( $this, 'admin_menu' ) ); - add_action( 'admin_head', array( $this, 'dismiss' ) ); - - // Prevent the normal links from showing underneath a single install/update page. - add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); - add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); - - if ( $this->has_notices ) { - add_action( 'admin_notices', array( $this, 'notices' ) ); - add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); - add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); - } - } - - // If needed, filter plugin action links. - add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); - - // Make sure things get reset on switch theme. - add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); - - if ( $this->has_notices ) { - add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); - } - - // Setup the force activation hook. - if ( true === $this->has_forced_activation ) { - add_action( 'admin_init', array( $this, 'force_activation' ) ); - } - - // Setup the force deactivation hook. - if ( true === $this->has_forced_deactivation ) { - add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); - } - } - - /** - * Hook in plugin action link filters for the WP native plugins page. - * - * - Prevent activation of plugins which don't meet the minimum version requirements. - * - Prevent deactivation of force-activated plugins. - * - Add update notice if update available. - * - * @since 2.5.0 - */ - public function add_plugin_action_link_filters() { - foreach ( $this->plugins as $slug => $plugin ) { - if ( false === $this->can_plugin_activate( $slug ) ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); - } - - if ( true === $plugin['force_activation'] ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); - } - - if ( false !== $this->does_plugin_require_update( $slug ) ) { - add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); - } - } - } - - /** - * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the - * minimum version requirements. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_activate( $actions ) { - unset( $actions['activate'] ); - - return $actions; - } - - /** - * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_deactivate( $actions ) { - unset( $actions['deactivate'] ); - - return $actions; - } - - /** - * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the - * minimum version requirements. - * - * @since 2.5.0 - * - * @param array $actions Action links. - * @return array - */ - public function filter_plugin_action_links_update( $actions ) { - $actions['update'] = sprintf( - '%3$s', - esc_url( $this->get_tgmpa_status_url( 'update' ) ), - esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'anaglyph-lite' ), - esc_html__( 'Update Required', 'anaglyph-lite' ) - ); - - return $actions; - } - - /** - * Handles calls to show plugin information via links in the notices. - * - * We get the links in the admin notices to point to the TGMPA page, rather - * than the typical plugin-install.php file, so we can prepare everything - * beforehand. - * - * WP does not make it easy to show the plugin information in the thickbox - - * here we have to require a file that includes a function that does the - * main work of displaying it, enqueue some styles, set up some globals and - * finally call that function before exiting. - * - * Down right easy once you know how... - * - * Returns early if not the TGMPA page. - * - * @since 2.1.0 - * - * @global string $tab Used as iframe div class names, helps with styling - * @global string $body_id Used as the iframe body ID, helps with styling - * - * @return null Returns early if not the TGMPA page. - */ - public function admin_init() { - if ( ! $this->is_tgmpa_page() ) { - return; - } - - if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { - // Needed for install_plugin_information(). - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - - wp_enqueue_style( 'plugin-install' ); - - global $tab, $body_id; - $body_id = 'plugin-information'; - // @codingStandardsIgnoreStart - $tab = 'plugin-information'; - // @codingStandardsIgnoreEnd - - install_plugin_information(); - - exit; - } - } - - /** - * Enqueue thickbox scripts/styles for plugin info. - * - * Thickbox is not automatically included on all admin pages, so we must - * manually enqueue it for those pages. - * - * Thickbox is only loaded if the user has not dismissed the admin - * notice or if there are any plugins left to install and activate. - * - * @since 2.1.0 - */ - public function thickbox() { - if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { - add_thickbox(); - } - } - - /** - * Adds submenu page if there are plugin actions to take. - * - * This method adds the submenu page letting users know that a required - * plugin needs to be installed. - * - * This page disappears once the plugin has been installed and activated. - * - * @since 1.0.0 - * - * @see TGM_Plugin_Activation::init() - * @see TGM_Plugin_Activation::install_plugins_page() - * - * @return null Return early if user lacks capability to install a plugin. - */ - public function admin_menu() { - // Make sure privileges are correct to see the page. - if ( ! current_user_can( 'install_plugins' ) ) { - return; - } - - $args = apply_filters( - 'tgmpa_admin_menu_args', - array( - 'parent_slug' => $this->parent_slug, // Parent Menu slug. - 'page_title' => $this->strings['page_title'], // Page title. - 'menu_title' => $this->strings['menu_title'], // Menu title. - 'capability' => $this->capability, // Capability. - 'menu_slug' => $this->menu, // Menu slug. - 'function' => array( $this, 'install_plugins_page' ), // Callback. - ) - ); - - $this->add_admin_menu( $args ); - } - - /** - * Add the menu item. - * - * @since 2.5.0 - * - * @param array $args Menu item configuration. - */ - protected function add_admin_menu( array $args ) { - if ( has_filter( 'tgmpa_admin_menu_use_add_theme_page' ) ) { - _deprecated_function( 'The "tgmpa_admin_menu_use_add_theme_page" filter', '2.5.0', esc_html__( 'Set the parent_slug config variable instead.', 'anaglyph-lite' ) ); - } - - $this->page_hook = call_user_func( 'add_theme_page', $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); - } - - /** - * Echoes plugin installation form. - * - * This method is the callback for the admin_menu method function. - * This displays the admin page and form area where the user can select to install and activate the plugin. - * Aborts early if we're processing a plugin installation action. - * - * @since 1.0.0 - * - * @return null Aborts early if we're processing a plugin installation action. - */ - public function install_plugins_page() { - // Store new instance of plugin table in object. - $plugin_table = new TGMPA_List_Table; - - // Return early if processing a plugin installation action. - if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { - return; - } - - // Force refresh of available plugin information so we'll know about manual updates/deletes. - wp_clean_plugins_cache( false ); - - ?> -
    -

    - prepare_items(); ?> - - message ) && is_string( $this->message ) ) { - echo wp_kses_post( $this->message ); - } - ?> - views(); ?> - -
    - - - display(); ?> -
    -
    - sanitize_key( urldecode( $_GET['plugin'] ) ); - - if ( ! isset( $this->plugins[ $slug ] ) ) { - return false; - } - - // Was an install or upgrade action link clicked? - if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { - - $install_type = 'install'; - if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { - $install_type = 'update'; - } - - check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); - - // Pass necessary information via URL if WP_Filesystem is needed. - $url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( $slug ), - 'tgmpa-' . $install_type => $install_type . '-plugin', - ), - $this->get_tgmpa_url() - ), - 'tgmpa-' . $install_type, - 'tgmpa-nonce' - ); - - $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. - - if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { - return true; - } - - if ( ! WP_Filesystem( $creds ) ) { - request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. - return true; - } - - /* If we arrive here, we have the filesystem. */ - - // Prep variables for Plugin_Installer_Skin class. - $extra = array(); - $extra['slug'] = $slug; // Needed for potentially renaming of directory name. - $source = $this->get_download_url( $slug ); - $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; - $api = ( false !== $api ) ? $api : null; - - $url = add_query_arg( - array( - 'action' => $install_type . '-plugin', - 'plugin' => urlencode( $slug ), - ), - 'update.php' - ); - - if ( ! class_exists( 'Plugin_Upgrader', false ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - } - - $skin_args = array( - 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', - 'title' => sprintf( $this->strings['installing'], $this->plugins[ $slug ]['name'] ), - 'url' => esc_url_raw( $url ), - 'nonce' => $install_type . '-plugin_' . $slug, - 'plugin' => '', - 'api' => $api, - 'extra' => $extra, - ); - - if ( 'update' === $install_type ) { - $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; - $skin = new Plugin_Upgrader_Skin( $skin_args ); - } else { - $skin = new Plugin_Installer_Skin( $skin_args ); - } - - // Create a new instance of Plugin_Upgrader. - $upgrader = new Plugin_Upgrader( $skin ); - - // Perform the action and install the plugin from the $source urldecode(). - add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); - - if ( 'update' === $install_type ) { - // Inject our info into the update transient. - $to_inject = array( $slug => $this->plugins[ $slug ] ); - $to_inject[ $slug ]['source'] = $source; - $this->inject_update_info( $to_inject ); - - $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); - } else { - $upgrader->install( $source ); - } - - remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); - - // Make sure we have the correct file path now the plugin is installed/updated. - $this->populate_file_path( $slug ); - - // Only activate plugins if the config option is set to true and the plugin isn't - // already active (upgrade). - if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { - $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. - if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { - return true; // Finish execution of the function early as we encountered an error. - } - } - - $this->show_tgmpa_version(); - - // Display message based on if all plugins are now active or not. - if ( $this->is_tgmpa_complete() ) { - echo '

    ', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'anaglyph-lite' ) . '' ), '

    '; - echo ''; - } else { - echo '

    ', esc_html( $this->strings['return'] ), '

    '; - } - - return true; - } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { - // Activate action link was clicked. - check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); - - if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { - return true; // Finish execution of the function early as we encountered an error. - } - } - - return false; - } - - /** - * Inject information into the 'update_plugins' site transient as WP checks that before running an update. - * - * @since 2.5.0 - * - * @param array $plugins The plugin information for the plugins which are to be updated. - */ - public function inject_update_info( $plugins ) { - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( ! is_object( $repo_updates ) ) { - $repo_updates = new stdClass; - } - - foreach ( $plugins as $slug => $plugin ) { - $file_path = $plugin['file_path']; - - if ( empty( $repo_updates->response[ $file_path ] ) ) { - $repo_updates->response[ $file_path ] = new stdClass; - } - - // We only really need to set package, but let's do all we can in case WP changes something. - $repo_updates->response[ $file_path ]->slug = $slug; - $repo_updates->response[ $file_path ]->plugin = $file_path; - $repo_updates->response[ $file_path ]->new_version = $plugin['version']; - $repo_updates->response[ $file_path ]->package = $plugin['source']; - if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { - $repo_updates->response[ $file_path ]->url = $plugin['external_url']; - } - } - - set_site_transient( 'update_plugins', $repo_updates ); - } - - /** - * Adjust the plugin directory name if necessary. - * - * The final destination directory of a plugin is based on the subdirectory name found in the - * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this - * subdirectory name is not the same as the expected slug and the plugin will not be recognized - * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to - * the expected plugin slug. - * - * @since 2.5.0 - * - * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. - * @param string $remote_source Path to upgrade/zip-file-name.tmp. - * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. - * @return string $source - */ - public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { - if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { - return $source; - } - - // Check for single file plugins. - $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); - if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { - return $source; - } - - // Multi-file plugin, let's see if the directory is correctly named. - $desired_slug = ''; - - // Figure out what the slug is supposed to be. - if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { - $desired_slug = $upgrader->skin->options['extra']['slug']; - } else { - // Bulk installer contains less info, so fall back on the info registered here. - foreach ( $this->plugins as $slug => $plugin ) { - if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { - $desired_slug = $slug; - break; - } - } - unset( $slug, $plugin ); - } - - if ( ! empty( $desired_slug ) ) { - $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); - - if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { - $from = untrailingslashit( $source ); - $to = trailingslashit( $remote_source ) . $desired_slug; - - if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) { - return trailingslashit( $to ); - } else { - return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'anaglyph-lite' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); - } - } elseif ( empty( $subdir_name ) ) { - return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'anaglyph-lite' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); - } - } - - return $source; - } - - /** - * Activate a single plugin and send feedback about the result to the screen. - * - * @since 2.5.0 - * - * @param string $file_path Path within wp-plugins/ to main plugin file. - * @param string $slug Plugin slug. - * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. - * This determines the styling of the output messages. - * @return bool False if an error was encountered, true otherwise. - */ - protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { - if ( $this->can_plugin_activate( $slug ) ) { - $activate = activate_plugin( $file_path ); - - if ( is_wp_error( $activate ) ) { - echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    ', - '

    ', esc_html( $this->strings['return'] ), '

    '; - - return false; // End it here if there is an error with activation. - } else { - if ( ! $automatic ) { - // Make sure message doesn't display again if bulk activation is performed - // immediately after a single activation. - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. - echo '

    ', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

    '; - } - } else { - // Simpler message layout for use on the plugin install page. - echo '

    ', esc_html( $this->strings['plugin_activated'] ), '

    '; - } - } - } elseif ( $this->is_plugin_active( $slug ) ) { - // No simpler message format provided as this message should never be encountered - // on the plugin install page. - echo '

    ', - sprintf( - esc_html( $this->strings['plugin_already_active'] ), - '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' - ), - '

    '; - } elseif ( $this->does_plugin_require_update( $slug ) ) { - if ( ! $automatic ) { - // Make sure message doesn't display again if bulk activation is performed - // immediately after a single activation. - if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. - echo '

    ', - sprintf( - esc_html( $this->strings['plugin_needs_higher_version'] ), - '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' - ), - '

    '; - } - } else { - // Simpler message layout for use on the plugin install page. - echo '

    ', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

    '; - } - } - - return true; - } - - /** - * Echoes required plugin notice. - * - * Outputs a message telling users that a specific plugin is required for - * their theme. If appropriate, it includes a link to the form page where - * users can install and activate the plugin. - * - * Returns early if we're on the Install page. - * - * @since 1.0.0 - * - * @global object $current_screen - * - * @return null Returns early if we're on the Install page. - */ - public function notices() { - // Remove nag on the install page / Return early if the nag message has been dismissed. - if ( $this->is_tgmpa_page() || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { - return; - } - - // Store for the plugin slugs by message type. - $message = array(); - - // Initialize counters used to determine plurality of action link texts. - $install_link_count = 0; - $update_link_count = 0; - $activate_link_count = 0; - - foreach ( $this->plugins as $slug => $plugin ) { - if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { - continue; - } - - if ( ! $this->is_plugin_installed( $slug ) ) { - if ( current_user_can( 'install_plugins' ) ) { - $install_link_count++; - - if ( true === $plugin['required'] ) { - $message['notice_can_install_required'][] = $slug; - } else { - $message['notice_can_install_recommended'][] = $slug; - } - } else { - // Need higher privileges to install the plugin. - $message['notice_cannot_install'][] = $slug; - } - } else { - if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { - if ( current_user_can( 'activate_plugins' ) ) { - $activate_link_count++; - - if ( true === $plugin['required'] ) { - $message['notice_can_activate_required'][] = $slug; - } else { - $message['notice_can_activate_recommended'][] = $slug; - } - } else { - // Need higher privileges to activate the plugin. - $message['notice_cannot_activate'][] = $slug; - } - } - - if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { - - if ( current_user_can( 'install_plugins' ) ) { - $update_link_count++; - - if ( $this->does_plugin_require_update( $slug ) ) { - $message['notice_ask_to_update'][] = $slug; - } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { - $message['notice_ask_to_update_maybe'][] = $slug; - } - } else { - // Need higher privileges to update the plugin. - $message['notice_cannot_update'][] = $slug; - } - } - } - } - unset( $slug, $plugin ); - - // If we have notices to display, we move forward. - if ( ! empty( $message ) ) { - krsort( $message ); // Sort messages. - $rendered = ''; - - // As add_settings_error() wraps the final message in a

    and as the final message can't be - // filtered, using

    's in our html would render invalid html output. - $line_template = '%s' . "\n"; - - // If dismissable is false and a message is set, output it now. - if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { - $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); - } - - // Render the individual message lines for the notice. - foreach ( $message as $type => $plugin_group ) { - $linked_plugins = array(); - - // Get the external info link for a plugin if one is available. - foreach ( $plugin_group as $plugin_slug ) { - $linked_plugins[] = $this->get_info_link( $plugin_slug ); - } - unset( $plugin_slug ); - - $count = count( $plugin_group ); - $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); - $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. - $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'anaglyph-lite' ) . ' ' . $last_plugin ); - - $rendered .= sprintf( - $line_template, - sprintf( - translate_nooped_plural( $this->strings[ $type ], $count, 'anaglyph-lite' ), - $imploded, - $count - ) - ); - - if ( 0 === strpos( $type, 'notice_cannot' ) ) { - $rendered .= $this->strings['contact_admin']; - } - } - unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); - - // Setup action links. - $action_links = array( - 'install' => '', - 'update' => '', - 'activate' => '', - 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', - ); - - $link_template = '%1$s'; - - if ( current_user_can( 'install_plugins' ) ) { - if ( $install_link_count > 0 ) { - $action_links['install'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['install_link'], $install_link_count, 'anaglyph-lite' ), - esc_url( $this->get_tgmpa_status_url( 'install' ) ) - ); - } - if ( $update_link_count > 0 ) { - $action_links['update'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['update_link'], $update_link_count, 'anaglyph-lite' ), - esc_url( $this->get_tgmpa_status_url( 'update' ) ) - ); - } - } - - if ( current_user_can( 'activate_plugins' ) && $activate_link_count > 0 ) { - $action_links['activate'] = sprintf( - $link_template, - translate_nooped_plural( $this->strings['activate_link'], $activate_link_count, 'anaglyph-lite' ), - esc_url( $this->get_tgmpa_status_url( 'activate' ) ) - ); - } - - $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); - - $action_links = array_filter( (array) $action_links ); // Remove any empty array items. - - if ( ! empty( $action_links ) && is_array( $action_links ) ) { - $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); - $rendered .= apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); - } - - // Register the nag messages and prepare them to be processed. - if ( ! empty( $this->strings['nag_type'] ) ) { - add_settings_error( 'tgmpa', 'tgmpa', $rendered, sanitize_html_class( strtolower( $this->strings['nag_type'] ) ) ); - } else { - $nag_class = version_compare( $this->wp_version, '3.8', '<' ) ? 'updated' : 'update-nag'; - add_settings_error( 'tgmpa', 'tgmpa', $rendered, $nag_class ); - } - } - - // Admin options pages already output settings_errors, so this is to avoid duplication. - if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { - $this->display_settings_errors(); - } - } - - /** - * Display settings errors and remove those which have been displayed to avoid duplicate messages showing - * - * @since 2.5.0 - */ - protected function display_settings_errors() { - global $wp_settings_errors; - - settings_errors( 'tgmpa' ); - - foreach ( (array) $wp_settings_errors as $key => $details ) { - if ( 'tgmpa' === $details['setting'] ) { - unset( $wp_settings_errors[ $key ] ); - break; - } - } - } - - /** - * Add dismissable admin notices. - * - * Appends a link to the admin nag messages. If clicked, the admin notice disappears and no longer is visible to users. - * - * @since 2.1.0 - */ - public function dismiss() { - if ( isset( $_GET['tgmpa-dismiss'] ) ) { - update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); - } - } - - /** - * Add individual plugin to our collection of plugins. - * - * If the required keys are not set or the plugin has already - * been registered, the plugin is not added. - * - * @since 2.0.0 - * - * @param array|null $plugin Array of plugin arguments or null if invalid argument. - * @return null Return early if incorrect argument. - */ - public function register( $plugin ) { - if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { - return; - } - - if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { - return; - } - - $defaults = array( - 'name' => '', // String - 'slug' => '', // String - 'source' => 'repo', // String - 'required' => false, // Boolean - 'version' => '', // String - 'force_activation' => false, // Boolean - 'force_deactivation' => false, // Boolean - 'external_url' => '', // String - 'is_callable' => '', // String|Array. - ); - - // Prepare the received data. - $plugin = wp_parse_args( $plugin, $defaults ); - - // Standardize the received slug. - $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); - - // Forgive users for using string versions of booleans or floats for version number. - $plugin['version'] = (string) $plugin['version']; - $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; - $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); - $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); - $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); - - // Enrich the received data. - $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); - $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); - - // Set the class properties. - $this->plugins[ $plugin['slug'] ] = $plugin; - $this->sort_order[ $plugin['slug'] ] = $plugin['name']; - - // Should we add the force activation hook ? - if ( true === $plugin['force_activation'] ) { - $this->has_forced_activation = true; - } - - // Should we add the force deactivation hook ? - if ( true === $plugin['force_deactivation'] ) { - $this->has_forced_deactivation = true; - } - } - - /** - * Determine what type of source the plugin comes from. - * - * @since 2.5.0 - * - * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path - * (= bundled) or an external URL. - * @return string 'repo', 'external', or 'bundled' - */ - protected function get_plugin_source_type( $source ) { - if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { - return 'repo'; - } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { - return 'external'; - } else { - return 'bundled'; - } - } - - /** - * Sanitizes a string key. - * - * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* - * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase - * characters in the plugin directory path/slug. Silly them. - * - * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ - * - * @since 2.5.0 - * - * @param string $key String key. - * @return string Sanitized key - */ - public function sanitize_key( $key ) { - $raw_key = $key; - $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); - - /** - * Filter a sanitized key string. - * - * @since 3.0.0 - * - * @param string $key Sanitized key. - * @param string $raw_key The key prior to sanitization. - */ - return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); - } - - /** - * Amend default configuration settings. - * - * @since 2.0.0 - * - * @param array $config Array of config options to pass as class properties. - */ - public function config( $config ) { - $keys = array( - 'id', - 'default_path', - 'has_notices', - 'dismissable', - 'dismiss_msg', - 'menu', - 'parent_slug', - 'capability', - 'is_automatic', - 'message', - 'strings', - ); - - foreach ( $keys as $key ) { - if ( isset( $config[ $key ] ) ) { - if ( is_array( $config[ $key ] ) ) { - $this->$key = array_merge( $this->$key, $config[ $key ] ); - } else { - $this->$key = $config[ $key ]; - } - } - } - } - - /** - * Amend action link after plugin installation. - * - * @since 2.0.0 - * - * @param array $install_actions Existing array of actions. - * @return array Amended array of actions. - */ - public function actions( $install_actions ) { - // Remove action links on the TGMPA install page. - if ( $this->is_tgmpa_page() ) { - return false; - } - - return $install_actions; - } - - /** - * Flushes the plugins cache on theme switch to prevent stale entries - * from remaining in the plugin table. - * - * @since 2.4.0 - * - * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. - * Parameter added in v2.5.0. - */ - public function flush_plugins_cache( $clear_update_cache = true ) { - wp_clean_plugins_cache( $clear_update_cache ); - } - - /** - * Set file_path key for each installed plugin. - * - * @since 2.1.0 - * - * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. - * Parameter added in v2.5.0. - */ - public function populate_file_path( $plugin_slug = '' ) { - if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { - $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); - } else { - // Add file_path key for all plugins. - foreach ( $this->plugins as $slug => $values ) { - $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); - } - } - } - - /** - * Helper function to extract the file path of the plugin file from the - * plugin slug, if the plugin is installed. - * - * @since 2.0.0 - * - * @param string $slug Plugin slug (typically folder name) as provided by the developer. - * @return string Either file path for plugin if installed, or just the plugin slug. - */ - protected function _get_plugin_basename_from_slug( $slug ) { - $keys = array_keys( $this->get_plugins() ); - - foreach ( $keys as $key ) { - if ( preg_match( '|^' . $slug . '/|', $key ) ) { - return $key; - } - } - - return $slug; - } - - /** - * Retrieve plugin data, given the plugin name. - * - * Loops through the registered plugins looking for $name. If it finds it, - * it returns the $data from that plugin. Otherwise, returns false. - * - * @since 2.1.0 - * - * @param string $name Name of the plugin, as it was registered. - * @param string $data Optional. Array key of plugin data to return. Default is slug. - * @return string|boolean Plugin slug if found, false otherwise. - */ - public function _get_plugin_data_from_name( $name, $data = 'slug' ) { - foreach ( $this->plugins as $values ) { - if ( $name === $values['name'] && isset( $values[ $data ] ) ) { - return $values[ $data ]; - } - } - - return false; - } - - /** - * Retrieve the download URL for a package. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Plugin download URL or path to local file or empty string if undetermined. - */ - public function get_download_url( $slug ) { - $dl_source = ''; - - switch ( $this->plugins[ $slug ]['source_type'] ) { - case 'repo': - return $this->get_wp_repo_download_url( $slug ); - case 'external': - return $this->plugins[ $slug ]['source']; - case 'bundled': - return $this->default_path . $this->plugins[ $slug ]['source']; - } - - return $dl_source; // Should never happen. - } - - /** - * Retrieve the download URL for a WP repo package. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Plugin download URL. - */ - protected function get_wp_repo_download_url( $slug ) { - $source = ''; - $api = $this->get_plugins_api( $slug ); - - if ( false !== $api && isset( $api->download_link ) ) { - $source = $api->download_link; - } - - return $source; - } - - /** - * Try to grab information from WordPress API. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return object Plugins_api response object on success, WP_Error on failure. - */ - protected function get_plugins_api( $slug ) { - static $api = array(); // Cache received responses. - - if ( ! isset( $api[ $slug ] ) ) { - if ( ! function_exists( 'plugins_api' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - } - - $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); - - $api[ $slug ] = false; - - if ( is_wp_error( $response ) ) { - wp_die( esc_html( $this->strings['oops'] ) ); - } else { - $api[ $slug ] = $response; - } - } - - return $api[ $slug ]; - } - - /** - * Retrieve a link to a plugin information page. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Fully formed html link to a plugin information page if available - * or the plugin name if not. - */ - public function get_info_link( $slug ) { - if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { - $link = sprintf( - '%2$s', - esc_url( $this->plugins[ $slug ]['external_url'] ), - esc_html( $this->plugins[ $slug ]['name'] ) - ); - } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { - $url = add_query_arg( - array( - 'tab' => 'plugin-information', - 'plugin' => urlencode( $slug ), - 'TB_iframe' => 'true', - 'width' => '640', - 'height' => '500', - ), - self_admin_url( 'plugin-install.php' ) - ); - - $link = sprintf( - '%2$s', - esc_url( $url ), - esc_html( $this->plugins[ $slug ]['name'] ) - ); - } else { - $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. - } - - return $link; - } - - /** - * Determine if we're on the TGMPA Install page. - * - * @since 2.1.0 - * - * @return boolean True when on the TGMPA page, false otherwise. - */ - protected function is_tgmpa_page() { - return isset( $_GET['page'] ) && $this->menu === $_GET['page']; - } - - /** - * Retrieve the URL to the TGMPA Install page. - * - * I.e. depending on the config settings passed something along the lines of: - * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins - * - * @since 2.5.0 - * - * @return string Properly encoded URL (not escaped). - */ - public function get_tgmpa_url() { - static $url; - - if ( ! isset( $url ) ) { - $parent = $this->parent_slug; - if ( false === strpos( $parent, '.php' ) ) { - $parent = 'admin.php'; - } - $url = add_query_arg( - array( - 'page' => urlencode( $this->menu ), - ), - self_admin_url( $parent ) - ); - } - - return $url; - } - - /** - * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). - * - * I.e. depending on the config settings passed something along the lines of: - * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install - * - * @since 2.5.0 - * - * @param string $status Plugin status - either 'install', 'update' or 'activate'. - * @return string Properly encoded URL (not escaped). - */ - public function get_tgmpa_status_url( $status ) { - return add_query_arg( - array( - 'plugin_status' => urlencode( $status ), - ), - $this->get_tgmpa_url() - ); - } - - /** - * Determine whether there are open actions for plugins registered with TGMPA. - * - * @since 2.5.0 - * - * @return bool True if complete, i.e. no outstanding actions. False otherwise. - */ - public function is_tgmpa_complete() { - $complete = true; - foreach ( $this->plugins as $slug => $plugin ) { - if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { - $complete = false; - break; - } - } - - return $complete; - } - - /** - * Check if a plugin is installed. Does not take must-use plugins into account. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if installed, false otherwise. - */ - public function is_plugin_installed( $slug ) { - $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). - - return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); - } - - /** - * Check if a plugin is active. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if active, false otherwise. - */ - public function is_plugin_active( $slug ) { - return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); - } - - /** - * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required - * available, check whether the current install meets them. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if OK to update, false otherwise. - */ - public function can_plugin_update( $slug ) { - // We currently can't get reliable info on non-WP-repo plugins - issue #380. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - return true; - } - - $api = $this->get_plugins_api( $slug ); - - if ( false !== $api && isset( $api->requires ) ) { - return version_compare( $GLOBALS['wp_version'], $api->requires, '>=' ); - } - - // No usable info received from the plugins API, presume we can update. - return true; - } - - /** - * Check if a plugin can be activated, i.e. is not currently active and meets the minimum - * plugin version requirements set in TGMPA (if any). - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True if OK to activate, false otherwise. - */ - public function can_plugin_activate( $slug ) { - return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); - } - - /** - * Retrieve the version number of an installed plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string Version number as string or an empty string if the plugin is not installed - * or version unknown (plugins which don't comply with the plugin header standard). - */ - public function get_installed_version( $slug ) { - $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). - - if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { - return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; - } - - return ''; - } - - /** - * Check whether a plugin complies with the minimum version requirements. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return bool True when a plugin needs to be updated, otherwise false. - */ - public function does_plugin_require_update( $slug ) { - $installed_version = $this->get_installed_version( $slug ); - $minimum_version = $this->plugins[ $slug ]['version']; - - return version_compare( $minimum_version, $installed_version, '>' ); - } - - /** - * Check whether there is an update available for a plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return false|string Version number string of the available update or false if no update available. - */ - public function does_plugin_have_update( $slug ) { - // Presume bundled and external plugins will point to a package which meets the minimum required version. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - if ( $this->does_plugin_require_update( $slug ) ) { - return $this->plugins[ $slug ]['version']; - } - - return false; - } - - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; - } - - return false; - } - - /** - * Retrieve potential upgrade notice for a plugin. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string The upgrade notice or an empty string if no message was available or provided. - */ - public function get_upgrade_notice( $slug ) { - // We currently can't get reliable info on non-WP-repo plugins - issue #380. - if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { - return ''; - } - - $repo_updates = get_site_transient( 'update_plugins' ); - - if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { - return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; - } - - return ''; - } - - /** - * Wrapper around the core WP get_plugins function, making sure it's actually available. - * - * @since 2.5.0 - * - * @param string $plugin_folder Optional. Relative path to single plugin folder. - * @return array Array of installed plugins with plugin information. - */ - public function get_plugins( $plugin_folder = '' ) { - if ( ! function_exists( 'get_plugins' ) ) { - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - } - - return get_plugins( $plugin_folder ); - } - - /** - * Delete dismissable nag option when theme is switched. - * - * This ensures that the user(s) is/are again reminded via nag of required - * and/or recommended plugins if they re-activate the theme. - * - * @since 2.1.1 - */ - public function update_dismiss() { - delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); - } - - /** - * Forces plugin activation if the parameter 'force_activation' is - * set to true. - * - * This allows theme authors to specify certain plugins that must be - * active at all times while using the current theme. - * - * Please take special care when using this parameter as it has the - * potential to be harmful if not used correctly. Setting this parameter - * to true will not allow the specified plugin to be deactivated unless - * the user switches themes. - * - * @since 2.2.0 - */ - public function force_activation() { - foreach ( $this->plugins as $slug => $plugin ) { - if ( true === $plugin['force_activation'] ) { - if ( ! $this->is_plugin_installed( $slug ) ) { - // Oops, plugin isn't there so iterate to next condition. - continue; - } elseif ( $this->can_plugin_activate( $slug ) ) { - // There we go, activate the plugin. - activate_plugin( $plugin['file_path'] ); - } - } - } - } - - /** - * Forces plugin deactivation if the parameter 'force_deactivation' - * is set to true. - * - * This allows theme authors to specify certain plugins that must be - * deactivated upon switching from the current theme to another. - * - * Please take special care when using this parameter as it has the - * potential to be harmful if not used correctly. - * - * @since 2.2.0 - */ - public function force_deactivation() { - foreach ( $this->plugins as $slug => $plugin ) { - // Only proceed forward if the parameter is set to true and plugin is active. - if ( true === $plugin['force_deactivation'] && $this->is_plugin_active( $slug ) ) { - deactivate_plugins( $plugin['file_path'] ); - } - } - } - - /** - * Echo the current TGMPA version number to the page. - */ - public function show_tgmpa_version() { - echo '

    ', - esc_html( sprintf( _x( 'TGMPA v%s', '%s = version number', 'anaglyph-lite' ), self::TGMPA_VERSION ) ), - '

    '; - } - - /** - * Returns the singleton instance of the class. - * - * @since 2.4.0 - * - * @return object The TGM_Plugin_Activation object. - */ - public static function get_instance() { - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { - self::$instance = new self(); - } - - return self::$instance; - } - } - - if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { - /** - * Ensure only one instance of the class is ever invoked. - */ - function load_tgm_plugin_activation() { - $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); - } - } - - if ( did_action( 'plugins_loaded' ) ) { - load_tgm_plugin_activation(); - } else { - add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); - } + /** + * Automatic plugin installation and activation library. + * + * Creates a way to automatically install and activate plugins from within themes. + * The plugins can be either bundled, downloaded from the WordPress + * Plugin Repository or downloaded from another external source. + * + * @since 1.0.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGM_Plugin_Activation { + /** + * TGMPA version number. + * + * @since 2.5.0 + * + * @const string Version number. + */ + const TGMPA_VERSION = '2.6.1'; + + /** + * Regular expression to test if a URL is a WP plugin repo URL. + * + * @const string Regex. + * + * @since 2.5.0 + */ + const WP_REPO_REGEX = '|^http[s]?://wordpress\.org/(?:extend/)?plugins/|'; + + /** + * Arbitrary regular expression to test if a string starts with a URL. + * + * @const string Regex. + * + * @since 2.5.0 + */ + const IS_URL_REGEX = '|^http[s]?://|'; + + /** + * Holds a copy of itself, so it can be referenced by the class name. + * + * @since 1.0.0 + * + * @var TGM_Plugin_Activation + */ + public static $instance; + + /** + * Holds arrays of plugin details. + * + * @since 1.0.0 + * @since 2.5.0 the array has the plugin slug as an associative key. + * + * @var array + */ + public $plugins = array(); + + /** + * Holds arrays of plugin names to use to sort the plugins array. + * + * @since 2.5.0 + * + * @var array + */ + protected $sort_order = array(); + + /** + * Whether any plugins have the 'force_activation' setting set to true. + * + * @since 2.5.0 + * + * @var bool + */ + protected $has_forced_activation = false; + + /** + * Whether any plugins have the 'force_deactivation' setting set to true. + * + * @since 2.5.0 + * + * @var bool + */ + protected $has_forced_deactivation = false; + + /** + * Name of the unique ID to hash notices. + * + * @since 2.4.0 + * + * @var string + */ + public $id = 'tgmpa'; + + /** + * Name of the query-string argument for the admin page. + * + * @since 1.0.0 + * + * @var string + */ + protected $menu = 'tgmpa-install-plugins'; + + /** + * Parent menu file slug. + * + * @since 2.5.0 + * + * @var string + */ + public $parent_slug = 'themes.php'; + + /** + * Capability needed to view the plugin installation menu item. + * + * @since 2.5.0 + * + * @var string + */ + public $capability = 'edit_theme_options'; + + /** + * Default absolute path to folder containing bundled plugin zip files. + * + * @since 2.0.0 + * + * @var string Absolute path prefix to zip file location for bundled plugins. Default is empty string. + */ + public $default_path = ''; + + /** + * Flag to show admin notices or not. + * + * @since 2.1.0 + * + * @var boolean + */ + public $has_notices = true; + + /** + * Flag to determine if the user can dismiss the notice nag. + * + * @since 2.4.0 + * + * @var boolean + */ + public $dismissable = true; + + /** + * Message to be output above nag notice if dismissable is false. + * + * @since 2.4.0 + * + * @var string + */ + public $dismiss_msg = ''; + + /** + * Flag to set automatic activation of plugins. Off by default. + * + * @since 2.2.0 + * + * @var boolean + */ + public $is_automatic = false; + + /** + * Optional message to display before the plugins table. + * + * @since 2.2.0 + * + * @var string Message filtered by wp_kses_post(). Default is empty string. + */ + public $message = ''; + + /** + * Holds configurable array of strings. + * + * Default values are added in the constructor. + * + * @since 2.0.0 + * + * @var array + */ + public $strings = array(); + + /** + * Holds the version of WordPress. + * + * @since 2.4.0 + * + * @var int + */ + public $wp_version; + + /** + * Holds the hook name for the admin page. + * + * @since 2.5.0 + * + * @var string + */ + public $page_hook; + + /** + * Adds a reference of this object to $instance, populates default strings, + * does the tgmpa_init action hook, and hooks in the interactions to init. + * + * {@internal This method should be `protected`, but as too many TGMPA implementations + * haven't upgraded beyond v2.3.6 yet, this gives backward compatibility issues. + * Reverted back to public for the time being.}} + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + */ + public function __construct() { + // Set the current WordPress version. + $this->wp_version = $GLOBALS['wp_version']; + + // Announce that the class is ready, and pass the object (for advanced use). + do_action_ref_array( 'tgmpa_init', array( $this ) ); + + + + // When the rest of WP has loaded, kick-start the rest of the class. + add_action( 'init', array( $this, 'init' ) ); + } + + /** + * Magic method to (not) set protected properties from outside of this class. + * + * {@internal hackedihack... There is a serious bug in v2.3.2 - 2.3.6 where the `menu` property + * is being assigned rather than tested in a conditional, effectively rendering it useless. + * This 'hack' prevents this from happening.}} + * + * @see https://github.com/TGMPA/TGM-Plugin-Activation/blob/2.3.6/tgm-plugin-activation/class-tgm-plugin-activation.php#L1593 + * + * @since 2.5.2 + * + * @param string $name Name of an inaccessible property. + * @param mixed $value Value to assign to the property. + * @return void Silently fail to set the property when this is tried from outside of this class context. + * (Inside this class context, the __set() method if not used as there is direct access.) + */ + public function __set( $name, $value ) { + return; + } + + /** + * Magic method to get the value of a protected property outside of this class context. + * + * @since 2.5.2 + * + * @param string $name Name of an inaccessible property. + * @return mixed The property value. + */ + public function __get( $name ) { + return $this->{$name}; + } + + /** + * Initialise the interactions between this class and WordPress. + * + * Hooks in three new methods for the class: admin_menu, notices and styles. + * + * @since 2.0.0 + * + * @see TGM_Plugin_Activation::admin_menu() + * @see TGM_Plugin_Activation::notices() + * @see TGM_Plugin_Activation::styles() + */ + public function init() { + /** + * By default TGMPA only loads on the WP back-end and not in an Ajax call. Using this filter + * you can overrule that behaviour. + * + * @since 2.5.0 + * + * @param bool $load Whether or not TGMPA should load. + * Defaults to the return of `is_admin() && ! defined( 'DOING_AJAX' )`. + */ + if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) { + return; + } + + // Load class strings. + $this->strings = array( + 'page_title' => __( 'Install Required Plugins', 'anaglyph-lite' ), + 'menu_title' => __( 'Install Plugins', 'anaglyph-lite' ), + /* translators: %s: plugin name. */ + 'installing' => __( 'Installing Plugin: %s', 'anaglyph-lite' ), + /* translators: %s: plugin name. */ + 'updating' => __( 'Updating Plugin: %s', 'anaglyph-lite' ), + 'oops' => __( 'Something went wrong with the plugin API.', 'anaglyph-lite' ), + 'notice_can_install_required' => _n_noop( + /* translators: 1: plugin name(s). */ + 'This theme requires the following plugin: %1$s.', + 'This theme requires the following plugins: %1$s.', + 'anaglyph-lite' + ), + 'notice_can_install_recommended' => _n_noop( + /* translators: 1: plugin name(s). */ + 'This theme recommends the following plugin: %1$s.', + 'This theme recommends the following plugins: %1$s.', + 'anaglyph-lite' + ), + 'notice_ask_to_update' => _n_noop( + /* translators: 1: plugin name(s). */ + 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', + 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', + 'anaglyph-lite' + ), + 'notice_ask_to_update_maybe' => _n_noop( + /* translators: 1: plugin name(s). */ + 'There is an update available for: %1$s.', + 'There are updates available for the following plugins: %1$s.', + 'anaglyph-lite' + ), + 'notice_can_activate_required' => _n_noop( + /* translators: 1: plugin name(s). */ + 'The following required plugin is currently inactive: %1$s.', + 'The following required plugins are currently inactive: %1$s.', + 'anaglyph-lite' + ), + 'notice_can_activate_recommended' => _n_noop( + /* translators: 1: plugin name(s). */ + 'The following recommended plugin is currently inactive: %1$s.', + 'The following recommended plugins are currently inactive: %1$s.', + 'anaglyph-lite' + ), + 'install_link' => _n_noop( + 'Begin installing plugin', + 'Begin installing plugins', + 'anaglyph-lite' + ), + 'update_link' => _n_noop( + 'Begin updating plugin', + 'Begin updating plugins', + 'anaglyph-lite' + ), + 'activate_link' => _n_noop( + 'Begin activating plugin', + 'Begin activating plugins', + 'anaglyph-lite' + ), + 'return' => __( 'Return to Required Plugins Installer', 'anaglyph-lite' ), + 'dashboard' => __( 'Return to the Dashboard', 'anaglyph-lite' ), + 'plugin_activated' => __( 'Plugin activated successfully.', 'anaglyph-lite' ), + 'activated_successfully' => __( 'The following plugin was activated successfully:', 'anaglyph-lite' ), + /* translators: 1: plugin name. */ + 'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'anaglyph-lite' ), + /* translators: 1: plugin name. */ + 'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'anaglyph-lite' ), + /* translators: 1: dashboard link. */ + 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'anaglyph-lite' ), + 'dismiss' => __( 'Dismiss this notice', 'anaglyph-lite' ), + 'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'anaglyph-lite' ), + 'contact_admin' => __( 'Please contact the administrator of this site for help.', 'anaglyph-lite' ), + ); + + do_action( 'tgmpa_register' ); + + /* After this point, the plugins should be registered and the configuration set. */ + + // Proceed only if we have plugins to handle. + if ( empty( $this->plugins ) || ! is_array( $this->plugins ) ) { + return; + } + + // Set up the menu and notices if we still have outstanding actions. + if ( true !== $this->is_tgmpa_complete() ) { + // Sort the plugins. + array_multisort( $this->sort_order, SORT_ASC, $this->plugins ); + + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + add_action( 'admin_head', array( $this, 'dismiss' ) ); + + // Prevent the normal links from showing underneath a single install/update page. + add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); + add_filter( 'update_plugin_complete_actions', array( $this, 'actions' ) ); + + if ( $this->has_notices ) { + add_action( 'admin_notices', array( $this, 'notices' ) ); + add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); + add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); + } + } + + // If needed, filter plugin action links. + add_action( 'load-plugins.php', array( $this, 'add_plugin_action_link_filters' ), 1 ); + + // Make sure things get reset on switch theme. + add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); + + if ( $this->has_notices ) { + add_action( 'switch_theme', array( $this, 'update_dismiss' ) ); + } + + // Setup the force activation hook. + if ( true === $this->has_forced_activation ) { + add_action( 'admin_init', array( $this, 'force_activation' ) ); + } + + // Setup the force deactivation hook. + if ( true === $this->has_forced_deactivation ) { + add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); + } + } + + + + + + + + /** + * Hook in plugin action link filters for the WP native plugins page. + * + * - Prevent activation of plugins which don't meet the minimum version requirements. + * - Prevent deactivation of force-activated plugins. + * - Add update notice if update available. + * + * @since 2.5.0 + */ + public function add_plugin_action_link_filters() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( false === $this->can_plugin_activate( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_activate' ), 20 ); + } + + if ( true === $plugin['force_activation'] ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_deactivate' ), 20 ); + } + + if ( false !== $this->does_plugin_require_update( $slug ) ) { + add_filter( 'plugin_action_links_' . $plugin['file_path'], array( $this, 'filter_plugin_action_links_update' ), 20 ); + } + } + } + + /** + * Remove the 'Activate' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_activate( $actions ) { + unset( $actions['activate'] ); + + return $actions; + } + + /** + * Remove the 'Deactivate' link on the WP native plugins page if the plugin has been set to force activate. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_deactivate( $actions ) { + unset( $actions['deactivate'] ); + + return $actions; + } + + /** + * Add a 'Requires update' link on the WP native plugins page if the plugin does not meet the + * minimum version requirements. + * + * @since 2.5.0 + * + * @param array $actions Action links. + * @return array + */ + public function filter_plugin_action_links_update( $actions ) { + $actions['update'] = sprintf( + '%3$s', + esc_url( $this->get_tgmpa_status_url( 'update' ) ), + esc_attr__( 'This plugin needs to be updated to be compatible with your theme.', 'anaglyph-lite' ), + esc_html__( 'Update Required', 'anaglyph-lite' ) + ); + + return $actions; + } + + /** + * Handles calls to show plugin information via links in the notices. + * + * We get the links in the admin notices to point to the TGMPA page, rather + * than the typical plugin-install.php file, so we can prepare everything + * beforehand. + * + * WP does not make it easy to show the plugin information in the thickbox - + * here we have to require a file that includes a function that does the + * main work of displaying it, enqueue some styles, set up some globals and + * finally call that function before exiting. + * + * Down right easy once you know how... + * + * Returns early if not the TGMPA page. + * + * @since 2.1.0 + * + * @global string $tab Used as iframe div class names, helps with styling + * @global string $body_id Used as the iframe body ID, helps with styling + * + * @return null Returns early if not the TGMPA page. + */ + public function admin_init() { + if ( ! $this->is_tgmpa_page() ) { + return; + } + + if ( isset( $_REQUEST['tab'] ) && 'plugin-information' === $_REQUEST['tab'] ) { + // Needed for install_plugin_information(). + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + + wp_enqueue_style( 'plugin-install' ); + + global $tab, $body_id; + $body_id = 'plugin-information'; + // @codingStandardsIgnoreStart + $tab = 'plugin-information'; + // @codingStandardsIgnoreEnd + + install_plugin_information(); + + exit; + } + } + + /** + * Enqueue thickbox scripts/styles for plugin info. + * + * Thickbox is not automatically included on all admin pages, so we must + * manually enqueue it for those pages. + * + * Thickbox is only loaded if the user has not dismissed the admin + * notice or if there are any plugins left to install and activate. + * + * @since 2.1.0 + */ + public function thickbox() { + if ( ! get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) ) { + add_thickbox(); + } + } + + /** + * Adds submenu page if there are plugin actions to take. + * + * This method adds the submenu page letting users know that a required + * plugin needs to be installed. + * + * This page disappears once the plugin has been installed and activated. + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + * @see TGM_Plugin_Activation::install_plugins_page() + * + * @return null Return early if user lacks capability to install a plugin. + */ + public function admin_menu() { + // Make sure privileges are correct to see the page. + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + $args = apply_filters( + 'tgmpa_admin_menu_args', + array( + 'parent_slug' => $this->parent_slug, // Parent Menu slug. + 'page_title' => $this->strings['page_title'], // Page title. + 'menu_title' => $this->strings['menu_title'], // Menu title. + 'capability' => $this->capability, // Capability. + 'menu_slug' => $this->menu, // Menu slug. + 'function' => array( $this, 'install_plugins_page' ), // Callback. + ) + ); + + $this->add_admin_menu( $args ); + } + + /** + * Add the menu item. + * + * {@internal IMPORTANT! If this function changes, review the regex in the custom TGMPA + * generator on the website.}} + * + * @since 2.5.0 + * + * @param array $args Menu item configuration. + */ + protected function add_admin_menu( array $args ) { + $this->page_hook = add_theme_page( $args['page_title'], $args['menu_title'], $args['capability'], $args['menu_slug'], $args['function'] ); + } + + /** + * Echoes plugin installation form. + * + * This method is the callback for the admin_menu method function. + * This displays the admin page and form area where the user can select to install and activate the plugin. + * Aborts early if we're processing a plugin installation action. + * + * @since 1.0.0 + * + * @return null Aborts early if we're processing a plugin installation action. + */ + public function install_plugins_page() { + // Store new instance of plugin table in object. + $plugin_table = new TGMPA_List_Table; + + // Return early if processing a plugin installation action. + if ( ( ( 'tgmpa-bulk-install' === $plugin_table->current_action() || 'tgmpa-bulk-update' === $plugin_table->current_action() ) && $plugin_table->process_bulk_actions() ) || $this->do_plugin_install() ) { + return; + } + + // Force refresh of available plugin information so we'll know about manual updates/deletes. + wp_clean_plugins_cache( false ); + + ?> +
    +

    + prepare_items(); ?> + + message ) && is_string( $this->message ) ) { + echo wp_kses_post( $this->message ); + } + ?> + views(); ?> + +
    + + + display(); ?> +
    +
    + sanitize_key( urldecode( $_GET['plugin'] ) ); + + if ( ! isset( $this->plugins[ $slug ] ) ) { + return false; + } + + // Was an install or upgrade action link clicked? + if ( ( isset( $_GET['tgmpa-install'] ) && 'install-plugin' === $_GET['tgmpa-install'] ) || ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) ) { + + $install_type = 'install'; + if ( isset( $_GET['tgmpa-update'] ) && 'update-plugin' === $_GET['tgmpa-update'] ) { + $install_type = 'update'; + } + + check_admin_referer( 'tgmpa-' . $install_type, 'tgmpa-nonce' ); + + // Pass necessary information via URL if WP_Filesystem is needed. + $url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $slug ), + 'tgmpa-' . $install_type => $install_type . '-plugin', + ), + $this->get_tgmpa_url() + ), + 'tgmpa-' . $install_type, + 'tgmpa-nonce' + ); + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, array() ) ) ) { + return true; + } + + if ( ! WP_Filesystem( $creds ) ) { + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, array() ); // Setup WP_Filesystem. + return true; + } + + /* If we arrive here, we have the filesystem. */ + + // Prep variables for Plugin_Installer_Skin class. + $extra = array(); + $extra['slug'] = $slug; // Needed for potentially renaming of directory name. + $source = $this->get_download_url( $slug ); + $api = ( 'repo' === $this->plugins[ $slug ]['source_type'] ) ? $this->get_plugins_api( $slug ) : null; + $api = ( false !== $api ) ? $api : null; + + $url = add_query_arg( + array( + 'action' => $install_type . '-plugin', + 'plugin' => urlencode( $slug ), + ), + 'update.php' + ); + + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + $title = ( 'update' === $install_type ) ? $this->strings['updating'] : $this->strings['installing']; + $skin_args = array( + 'type' => ( 'bundled' !== $this->plugins[ $slug ]['source_type'] ) ? 'web' : 'upload', + 'title' => sprintf( $title, $this->plugins[ $slug ]['name'] ), + 'url' => esc_url_raw( $url ), + 'nonce' => $install_type . '-plugin_' . $slug, + 'plugin' => '', + 'api' => $api, + 'extra' => $extra, + ); + unset( $title ); + + if ( 'update' === $install_type ) { + $skin_args['plugin'] = $this->plugins[ $slug ]['file_path']; + $skin = new Plugin_Upgrader_Skin( $skin_args ); + } else { + $skin = new Plugin_Installer_Skin( $skin_args ); + } + + // Create a new instance of Plugin_Upgrader. + $upgrader = new Plugin_Upgrader( $skin ); + + // Perform the action and install the plugin from the $source urldecode(). + add_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'update' === $install_type ) { + // Inject our info into the update transient. + $to_inject = array( $slug => $this->plugins[ $slug ] ); + $to_inject[ $slug ]['source'] = $source; + $this->inject_update_info( $to_inject ); + + $upgrader->upgrade( $this->plugins[ $slug ]['file_path'] ); + } else { + $upgrader->install( $source ); + } + + remove_filter( 'upgrader_source_selection', array( $this, 'maybe_adjust_source_dir' ), 1 ); + + // Make sure we have the correct file path now the plugin is installed/updated. + $this->populate_file_path( $slug ); + + // Only activate plugins if the config option is set to true and the plugin isn't + // already active (upgrade). + if ( $this->is_automatic && ! $this->is_plugin_active( $slug ) ) { + $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. + if ( false === $this->activate_single_plugin( $plugin_activate, $slug, true ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + $this->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + if ( $this->is_tgmpa_complete() ) { + echo '

    ', sprintf( esc_html( $this->strings['complete'] ), '' . esc_html__( 'Return to the Dashboard', 'anaglyph-lite' ) . '' ), '

    '; + echo ''; + } else { + echo '

    ', esc_html( $this->strings['return'] ), '

    '; + } + + return true; + } elseif ( isset( $this->plugins[ $slug ]['file_path'], $_GET['tgmpa-activate'] ) && 'activate-plugin' === $_GET['tgmpa-activate'] ) { + // Activate action link was clicked. + check_admin_referer( 'tgmpa-activate', 'tgmpa-nonce' ); + + if ( false === $this->activate_single_plugin( $this->plugins[ $slug ]['file_path'], $slug ) ) { + return true; // Finish execution of the function early as we encountered an error. + } + } + + return false; + } + + /** + * Inject information into the 'update_plugins' site transient as WP checks that before running an update. + * + * @since 2.5.0 + * + * @param array $plugins The plugin information for the plugins which are to be updated. + */ + public function inject_update_info( $plugins ) { + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! is_object( $repo_updates ) ) { + $repo_updates = new stdClass; + } + + foreach ( $plugins as $slug => $plugin ) { + $file_path = $plugin['file_path']; + + if ( empty( $repo_updates->response[ $file_path ] ) ) { + $repo_updates->response[ $file_path ] = new stdClass; + } + + // We only really need to set package, but let's do all we can in case WP changes something. + $repo_updates->response[ $file_path ]->slug = $slug; + $repo_updates->response[ $file_path ]->plugin = $file_path; + $repo_updates->response[ $file_path ]->new_version = $plugin['version']; + $repo_updates->response[ $file_path ]->package = $plugin['source']; + if ( empty( $repo_updates->response[ $file_path ]->url ) && ! empty( $plugin['external_url'] ) ) { + $repo_updates->response[ $file_path ]->url = $plugin['external_url']; + } + } + + set_site_transient( 'update_plugins', $repo_updates ); + } + + /** + * Adjust the plugin directory name if necessary. + * + * The final destination directory of a plugin is based on the subdirectory name found in the + * (un)zipped source. In some cases - most notably GitHub repository plugin downloads -, this + * subdirectory name is not the same as the expected slug and the plugin will not be recognized + * as installed. This is fixed by adjusting the temporary unzipped source subdirectory name to + * the expected plugin slug. + * + * @since 2.5.0 + * + * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/. + * @param string $remote_source Path to upgrade/zip-file-name.tmp. + * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin. + * @return string $source + */ + public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) { + if ( ! $this->is_tgmpa_page() || ! is_object( $GLOBALS['wp_filesystem'] ) ) { + return $source; + } + + // Check for single file plugins. + $source_files = array_keys( $GLOBALS['wp_filesystem']->dirlist( $remote_source ) ); + if ( 1 === count( $source_files ) && false === $GLOBALS['wp_filesystem']->is_dir( $source ) ) { + return $source; + } + + // Multi-file plugin, let's see if the directory is correctly named. + $desired_slug = ''; + + // Figure out what the slug is supposed to be. + if ( false === $upgrader->bulk && ! empty( $upgrader->skin->options['extra']['slug'] ) ) { + $desired_slug = $upgrader->skin->options['extra']['slug']; + } else { + // Bulk installer contains less info, so fall back on the info registered here. + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! empty( $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) && $plugin['name'] === $upgrader->skin->plugin_names[ $upgrader->skin->i ] ) { + $desired_slug = $slug; + break; + } + } + unset( $slug, $plugin ); + } + + if ( ! empty( $desired_slug ) ) { + $subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) ); + + if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) { + $from_path = untrailingslashit( $source ); + $to_path = trailingslashit( $remote_source ) . $desired_slug; + + if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) { + return trailingslashit( $to_path ); + } else { + return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'anaglyph-lite' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } elseif ( empty( $subdir_name ) ) { + return new WP_Error( 'packaged_wrong', esc_html__( 'The remote plugin package consists of more than one file, but the files are not packaged in a folder.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'anaglyph-lite' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) ); + } + } + + return $source; + } + + /** + * Activate a single plugin and send feedback about the result to the screen. + * + * @since 2.5.0 + * + * @param string $file_path Path within wp-plugins/ to main plugin file. + * @param string $slug Plugin slug. + * @param bool $automatic Whether this is an automatic activation after an install. Defaults to false. + * This determines the styling of the output messages. + * @return bool False if an error was encountered, true otherwise. + */ + protected function activate_single_plugin( $file_path, $slug, $automatic = false ) { + if ( $this->can_plugin_activate( $slug ) ) { + $activate = activate_plugin( $file_path ); + + if ( is_wp_error( $activate ) ) { + echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    ', + '

    ', esc_html( $this->strings['return'] ), '

    '; + + return false; // End it here if there is an error with activation. + } else { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

    ', esc_html( $this->strings['activated_successfully'] ), ' ', esc_html( $this->plugins[ $slug ]['name'] ), '.

    '; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

    ', esc_html( $this->strings['plugin_activated'] ), '

    '; + } + } + } elseif ( $this->is_plugin_active( $slug ) ) { + // No simpler message format provided as this message should never be encountered + // on the plugin install page. + echo '

    ', + sprintf( + esc_html( $this->strings['plugin_already_active'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

    '; + } elseif ( $this->does_plugin_require_update( $slug ) ) { + if ( ! $automatic ) { + // Make sure message doesn't display again if bulk activation is performed + // immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { // WPCS: CSRF OK. + echo '

    ', + sprintf( + esc_html( $this->strings['plugin_needs_higher_version'] ), + '' . esc_html( $this->plugins[ $slug ]['name'] ) . '' + ), + '

    '; + } + } else { + // Simpler message layout for use on the plugin install page. + echo '

    ', sprintf( esc_html( $this->strings['plugin_needs_higher_version'] ), esc_html( $this->plugins[ $slug ]['name'] ) ), '

    '; + } + } + + return true; + } + + /** + * Echoes required plugin notice. + * + * Outputs a message telling users that a specific plugin is required for + * their theme. If appropriate, it includes a link to the form page where + * users can install and activate the plugin. + * + * Returns early if we're on the Install page. + * + * @since 1.0.0 + * + * @global object $current_screen + * + * @return null Returns early if we're on the Install page. + */ + public function notices() { + // Remove nag on the install page / Return early if the nag message has been dismissed or user < author. + if ( ( $this->is_tgmpa_page() || $this->is_core_update_page() ) || get_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, true ) || ! current_user_can( apply_filters( 'tgmpa_show_admin_notice_capability', 'publish_posts' ) ) ) { + return; + } + + // Store for the plugin slugs by message type. + $message = array(); + + // Initialize counters used to determine plurality of action link texts. + $install_link_count = 0; + $update_link_count = 0; + $activate_link_count = 0; + $total_required_action_count = 0; + + foreach ( $this->plugins as $slug => $plugin ) { + if ( $this->is_plugin_active( $slug ) && false === $this->does_plugin_have_update( $slug ) ) { + continue; + } + + if ( ! $this->is_plugin_installed( $slug ) ) { + if ( current_user_can( 'install_plugins' ) ) { + $install_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_install_required'][] = $slug; + } else { + $message['notice_can_install_recommended'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } else { + if ( ! $this->is_plugin_active( $slug ) && $this->can_plugin_activate( $slug ) ) { + if ( current_user_can( 'activate_plugins' ) ) { + $activate_link_count++; + + if ( true === $plugin['required'] ) { + $message['notice_can_activate_required'][] = $slug; + } else { + $message['notice_can_activate_recommended'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } + + if ( $this->does_plugin_require_update( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + + if ( current_user_can( 'update_plugins' ) ) { + $update_link_count++; + + if ( $this->does_plugin_require_update( $slug ) ) { + $message['notice_ask_to_update'][] = $slug; + } elseif ( false !== $this->does_plugin_have_update( $slug ) ) { + $message['notice_ask_to_update_maybe'][] = $slug; + } + } + if ( true === $plugin['required'] ) { + $total_required_action_count++; + } + } + } + } + unset( $slug, $plugin ); + + // If we have notices to display, we move forward. + if ( ! empty( $message ) || $total_required_action_count > 0 ) { + krsort( $message ); // Sort messages. + $rendered = ''; + + // As add_settings_error() wraps the final message in a

    and as the final message can't be + // filtered, using

    's in our html would render invalid html output. + $line_template = '%s' . "\n"; + + if ( ! current_user_can( 'activate_plugins' ) && ! current_user_can( 'install_plugins' ) && ! current_user_can( 'update_plugins' ) ) { + $rendered = esc_html( $this->strings['notice_cannot_install_activate'] ) . ' ' . esc_html( $this->strings['contact_admin'] ); + $rendered .= $this->create_user_action_links_for_notice( 0, 0, 0, $line_template ); + } else { + + // If dismissable is false and a message is set, output it now. + if ( ! $this->dismissable && ! empty( $this->dismiss_msg ) ) { + $rendered .= sprintf( $line_template, wp_kses_post( $this->dismiss_msg ) ); + } + + // Render the individual message lines for the notice. + foreach ( $message as $type => $plugin_group ) { + $linked_plugins = array(); + + // Get the external info link for a plugin if one is available. + foreach ( $plugin_group as $plugin_slug ) { + $linked_plugins[] = $this->get_info_link( $plugin_slug ); + } + unset( $plugin_slug ); + + $count = count( $plugin_group ); + $linked_plugins = array_map( array( 'TGMPA_Utils', 'wrap_in_em' ), $linked_plugins ); + $last_plugin = array_pop( $linked_plugins ); // Pop off last name to prep for readability. + $imploded = empty( $linked_plugins ) ? $last_plugin : ( implode( ', ', $linked_plugins ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'anaglyph-lite' ) . ' ' . $last_plugin ); + + $rendered .= sprintf( + $line_template, + sprintf( + translate_nooped_plural( $this->strings[ $type ], $count, 'anaglyph-lite' ), + $imploded, + $count + ) + ); + + } + unset( $type, $plugin_group, $linked_plugins, $count, $last_plugin, $imploded ); + + $rendered .= $this->create_user_action_links_for_notice( $install_link_count, $update_link_count, $activate_link_count, $line_template ); + } + + // Register the nag messages and prepare them to be processed. + add_settings_error( 'tgmpa', 'tgmpa', $rendered, $this->get_admin_notice_class() ); + } + + // Admin options pages already output settings_errors, so this is to avoid duplication. + if ( 'options-general' !== $GLOBALS['current_screen']->parent_base ) { + $this->display_settings_errors(); + } + } + + /** + * Generate the user action links for the admin notice. + * + * @since 2.6.0 + * + * @param int $install_count Number of plugins to install. + * @param int $update_count Number of plugins to update. + * @param int $activate_count Number of plugins to activate. + * @param int $line_template Template for the HTML tag to output a line. + * @return string Action links. + */ + protected function create_user_action_links_for_notice( $install_count, $update_count, $activate_count, $line_template ) { + // Setup action links. + $action_links = array( + 'install' => '', + 'update' => '', + 'activate' => '', + 'dismiss' => $this->dismissable ? '' . esc_html( $this->strings['dismiss'] ) . '' : '', + ); + + $link_template = '%1$s'; + + if ( current_user_can( 'install_plugins' ) ) { + if ( $install_count > 0 ) { + $action_links['install'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['install_link'], $install_count, 'anaglyph-lite' ), + esc_url( $this->get_tgmpa_status_url( 'install' ) ) + ); + } + if ( $update_count > 0 ) { + $action_links['update'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['update_link'], $update_count, 'anaglyph-lite' ), + esc_url( $this->get_tgmpa_status_url( 'update' ) ) + ); + } + } + + if ( current_user_can( 'activate_plugins' ) && $activate_count > 0 ) { + $action_links['activate'] = sprintf( + $link_template, + translate_nooped_plural( $this->strings['activate_link'], $activate_count, 'anaglyph-lite' ), + esc_url( $this->get_tgmpa_status_url( 'activate' ) ) + ); + } + + $action_links = apply_filters( 'tgmpa_notice_action_links', $action_links ); + + $action_links = array_filter( (array) $action_links ); // Remove any empty array items. + + if ( ! empty( $action_links ) ) { + $action_links = sprintf( $line_template, implode( ' | ', $action_links ) ); + return apply_filters( 'tgmpa_notice_rendered_action_links', $action_links ); + } else { + return ''; + } + } + + /** + * Get admin notice class. + * + * Work around all the changes to the various admin notice classes between WP 4.4 and 3.7 + * (lowest supported version by TGMPA). + * + * @since 2.6.0 + * + * @return string + */ + protected function get_admin_notice_class() { + if ( ! empty( $this->strings['nag_type'] ) ) { + return sanitize_html_class( strtolower( $this->strings['nag_type'] ) ); + } else { + if ( version_compare( $this->wp_version, '4.2', '>=' ) ) { + return 'notice-warning'; + } elseif ( version_compare( $this->wp_version, '4.1', '>=' ) ) { + return 'notice'; + } else { + return 'updated'; + } + } + } + + /** + * Display settings errors and remove those which have been displayed to avoid duplicate messages showing + * + * @since 2.5.0 + */ + protected function display_settings_errors() { + global $wp_settings_errors; + + settings_errors( 'tgmpa' ); + + foreach ( (array) $wp_settings_errors as $key => $details ) { + if ( 'tgmpa' === $details['setting'] ) { + unset( $wp_settings_errors[ $key ] ); + break; + } + } + } + + /** + * Register dismissal of admin notices. + * + * Acts on the dismiss link in the admin nag messages. + * If clicked, the admin notice disappears and will no longer be visible to this user. + * + * @since 2.1.0 + */ + public function dismiss() { + if ( isset( $_GET['tgmpa-dismiss'] ) && check_admin_referer( 'tgmpa-dismiss-' . get_current_user_id() ) ) { + update_user_meta( get_current_user_id(), 'tgmpa_dismissed_notice_' . $this->id, 1 ); + } + } + + /** + * Add individual plugin to our collection of plugins. + * + * If the required keys are not set or the plugin has already + * been registered, the plugin is not added. + * + * @since 2.0.0 + * + * @param array|null $plugin Array of plugin arguments or null if invalid argument. + * @return null Return early if incorrect argument. + */ + public function register( $plugin ) { + if ( empty( $plugin['slug'] ) || empty( $plugin['name'] ) ) { + return; + } + + if ( empty( $plugin['slug'] ) || ! is_string( $plugin['slug'] ) || isset( $this->plugins[ $plugin['slug'] ] ) ) { + return; + } + + $defaults = array( + 'name' => '', // String + 'slug' => '', // String + 'source' => 'repo', // String + 'required' => false, // Boolean + 'version' => '', // String + 'force_activation' => false, // Boolean + 'force_deactivation' => false, // Boolean + 'external_url' => '', // String + 'is_callable' => '', // String|Array. + ); + + // Prepare the received data. + $plugin = wp_parse_args( $plugin, $defaults ); + + // Standardize the received slug. + $plugin['slug'] = $this->sanitize_key( $plugin['slug'] ); + + // Forgive users for using string versions of booleans or floats for version number. + $plugin['version'] = (string) $plugin['version']; + $plugin['source'] = empty( $plugin['source'] ) ? 'repo' : $plugin['source']; + $plugin['required'] = TGMPA_Utils::validate_bool( $plugin['required'] ); + $plugin['force_activation'] = TGMPA_Utils::validate_bool( $plugin['force_activation'] ); + $plugin['force_deactivation'] = TGMPA_Utils::validate_bool( $plugin['force_deactivation'] ); + + // Enrich the received data. + $plugin['file_path'] = $this->_get_plugin_basename_from_slug( $plugin['slug'] ); + $plugin['source_type'] = $this->get_plugin_source_type( $plugin['source'] ); + + // Set the class properties. + $this->plugins[ $plugin['slug'] ] = $plugin; + $this->sort_order[ $plugin['slug'] ] = $plugin['name']; + + // Should we add the force activation hook ? + if ( true === $plugin['force_activation'] ) { + $this->has_forced_activation = true; + } + + // Should we add the force deactivation hook ? + if ( true === $plugin['force_deactivation'] ) { + $this->has_forced_deactivation = true; + } + } + + /** + * Determine what type of source the plugin comes from. + * + * @since 2.5.0 + * + * @param string $source The source of the plugin as provided, either empty (= WP repo), a file path + * (= bundled) or an external URL. + * @return string 'repo', 'external', or 'bundled' + */ + protected function get_plugin_source_type( $source ) { + if ( 'repo' === $source || preg_match( self::WP_REPO_REGEX, $source ) ) { + return 'repo'; + } elseif ( preg_match( self::IS_URL_REGEX, $source ) ) { + return 'external'; + } else { + return 'bundled'; + } + } + + /** + * Sanitizes a string key. + * + * Near duplicate of WP Core `sanitize_key()`. The difference is that uppercase characters *are* + * allowed, so as not to break upgrade paths from non-standard bundled plugins using uppercase + * characters in the plugin directory path/slug. Silly them. + * + * @see https://developer.wordpress.org/reference/hooks/sanitize_key/ + * + * @since 2.5.0 + * + * @param string $key String key. + * @return string Sanitized key + */ + public function sanitize_key( $key ) { + $raw_key = $key; + $key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key ); + + /** + * Filter a sanitized key string. + * + * @since 2.5.0 + * + * @param string $key Sanitized key. + * @param string $raw_key The key prior to sanitization. + */ + return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key ); + } + + /** + * Amend default configuration settings. + * + * @since 2.0.0 + * + * @param array $config Array of config options to pass as class properties. + */ + public function config( $config ) { + $keys = array( + 'id', + 'default_path', + 'has_notices', + 'dismissable', + 'dismiss_msg', + 'menu', + 'parent_slug', + 'capability', + 'is_automatic', + 'message', + 'strings', + ); + + foreach ( $keys as $key ) { + if ( isset( $config[ $key ] ) ) { + if ( is_array( $config[ $key ] ) ) { + $this->$key = array_merge( $this->$key, $config[ $key ] ); + } else { + $this->$key = $config[ $key ]; + } + } + } + } + + /** + * Amend action link after plugin installation. + * + * @since 2.0.0 + * + * @param array $install_actions Existing array of actions. + * @return false|array Amended array of actions. + */ + public function actions( $install_actions ) { + // Remove action links on the TGMPA install page. + if ( $this->is_tgmpa_page() ) { + return false; + } + + return $install_actions; + } + + /** + * Flushes the plugins cache on theme switch to prevent stale entries + * from remaining in the plugin table. + * + * @since 2.4.0 + * + * @param bool $clear_update_cache Optional. Whether to clear the Plugin updates cache. + * Parameter added in v2.5.0. + */ + public function flush_plugins_cache( $clear_update_cache = true ) { + wp_clean_plugins_cache( $clear_update_cache ); + } + + /** + * Set file_path key for each installed plugin. + * + * @since 2.1.0 + * + * @param string $plugin_slug Optional. If set, only (re-)populates the file path for that specific plugin. + * Parameter added in v2.5.0. + */ + public function populate_file_path( $plugin_slug = '' ) { + if ( ! empty( $plugin_slug ) && is_string( $plugin_slug ) && isset( $this->plugins[ $plugin_slug ] ) ) { + $this->plugins[ $plugin_slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $plugin_slug ); + } else { + // Add file_path key for all plugins. + foreach ( $this->plugins as $slug => $values ) { + $this->plugins[ $slug ]['file_path'] = $this->_get_plugin_basename_from_slug( $slug ); + } + } + } + + /** + * Helper function to extract the file path of the plugin file from the + * plugin slug, if the plugin is installed. + * + * @since 2.0.0 + * + * @param string $slug Plugin slug (typically folder name) as provided by the developer. + * @return string Either file path for plugin if installed, or just the plugin slug. + */ + protected function _get_plugin_basename_from_slug( $slug ) { + $keys = array_keys( $this->get_plugins() ); + + foreach ( $keys as $key ) { + if ( preg_match( '|^' . $slug . '/|', $key ) ) { + return $key; + } + } + + return $slug; + } + + /** + * Retrieve plugin data, given the plugin name. + * + * Loops through the registered plugins looking for $name. If it finds it, + * it returns the $data from that plugin. Otherwise, returns false. + * + * @since 2.1.0 + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + public function _get_plugin_data_from_name( $name, $data = 'slug' ) { + foreach ( $this->plugins as $values ) { + if ( $name === $values['name'] && isset( $values[ $data ] ) ) { + return $values[ $data ]; + } + } + + return false; + } + + /** + * Retrieve the download URL for a package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL or path to local file or empty string if undetermined. + */ + public function get_download_url( $slug ) { + $dl_source = ''; + + switch ( $this->plugins[ $slug ]['source_type'] ) { + case 'repo': + return $this->get_wp_repo_download_url( $slug ); + case 'external': + return $this->plugins[ $slug ]['source']; + case 'bundled': + return $this->default_path . $this->plugins[ $slug ]['source']; + } + + return $dl_source; // Should never happen. + } + + /** + * Retrieve the download URL for a WP repo package. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Plugin download URL. + */ + protected function get_wp_repo_download_url( $slug ) { + $source = ''; + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->download_link ) ) { + $source = $api->download_link; + } + + return $source; + } + + /** + * Try to grab information from WordPress API. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return object Plugins_api response object on success, WP_Error on failure. + */ + protected function get_plugins_api( $slug ) { + static $api = array(); // Cache received responses. + + if ( ! isset( $api[ $slug ] ) ) { + if ( ! function_exists( 'plugins_api' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + } + + $response = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false ) ) ); + + $api[ $slug ] = false; + + if ( is_wp_error( $response ) ) { + wp_die( esc_html( $this->strings['oops'] ) ); + } else { + $api[ $slug ] = $response; + } + } + + return $api[ $slug ]; + } + + /** + * Retrieve a link to a plugin information page. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Fully formed html link to a plugin information page if available + * or the plugin name if not. + */ + public function get_info_link( $slug ) { + if ( ! empty( $this->plugins[ $slug ]['external_url'] ) && preg_match( self::IS_URL_REGEX, $this->plugins[ $slug ]['external_url'] ) ) { + $link = sprintf( + '%2$s', + esc_url( $this->plugins[ $slug ]['external_url'] ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } elseif ( 'repo' === $this->plugins[ $slug ]['source_type'] ) { + $url = add_query_arg( + array( + 'tab' => 'plugin-information', + 'plugin' => urlencode( $slug ), + 'TB_iframe' => 'true', + 'width' => '640', + 'height' => '500', + ), + self_admin_url( 'plugin-install.php' ) + ); + + $link = sprintf( + '%2$s', + esc_url( $url ), + esc_html( $this->plugins[ $slug ]['name'] ) + ); + } else { + $link = esc_html( $this->plugins[ $slug ]['name'] ); // No hyperlink. + } + + return $link; + } + + /** + * Determine if we're on the TGMPA Install page. + * + * @since 2.1.0 + * + * @return boolean True when on the TGMPA page, false otherwise. + */ + protected function is_tgmpa_page() { + return isset( $_GET['page'] ) && $this->menu === $_GET['page']; + } + + /** + * Determine if we're on a WP Core installation/upgrade page. + * + * @since 2.6.0 + * + * @return boolean True when on a WP Core installation/upgrade page, false otherwise. + */ + protected function is_core_update_page() { + // Current screen is not always available, most notably on the customizer screen. + if ( ! function_exists( 'get_current_screen' ) ) { + return false; + } + + $screen = get_current_screen(); + + if ( 'update-core' === $screen->base ) { + // Core update screen. + return true; + } elseif ( 'plugins' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. + // Plugins bulk update screen. + return true; + } elseif ( 'update' === $screen->base && ! empty( $_POST['action'] ) ) { // WPCS: CSRF ok. + // Individual updates (ajax call). + return true; + } + + return false; + } + + /** + * Retrieve the URL to the TGMPA Install page. + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins + * + * @since 2.5.0 + * + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_url() { + static $url; + + if ( ! isset( $url ) ) { + $parent = $this->parent_slug; + if ( false === strpos( $parent, '.php' ) ) { + $parent = 'admin.php'; + } + $url = add_query_arg( + array( + 'page' => urlencode( $this->menu ), + ), + self_admin_url( $parent ) + ); + } + + return $url; + } + + /** + * Retrieve the URL to the TGMPA Install page for a specific plugin status (view). + * + * I.e. depending on the config settings passed something along the lines of: + * http://example.com/wp-admin/themes.php?page=tgmpa-install-plugins&plugin_status=install + * + * @since 2.5.0 + * + * @param string $status Plugin status - either 'install', 'update' or 'activate'. + * @return string Properly encoded URL (not escaped). + */ + public function get_tgmpa_status_url( $status ) { + return add_query_arg( + array( + 'plugin_status' => urlencode( $status ), + ), + $this->get_tgmpa_url() + ); + } + + /** + * Determine whether there are open actions for plugins registered with TGMPA. + * + * @since 2.5.0 + * + * @return bool True if complete, i.e. no outstanding actions. False otherwise. + */ + public function is_tgmpa_complete() { + $complete = true; + foreach ( $this->plugins as $slug => $plugin ) { + if ( ! $this->is_plugin_active( $slug ) || false !== $this->does_plugin_have_update( $slug ) ) { + $complete = false; + break; + } + } + + return $complete; + } + + /** + * Check if a plugin is installed. Does not take must-use plugins into account. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if installed, false otherwise. + */ + public function is_plugin_installed( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + return ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ] ) ); + } + + /** + * Check if a plugin is active. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if active, false otherwise. + */ + public function is_plugin_active( $slug ) { + return ( ( ! empty( $this->plugins[ $slug ]['is_callable'] ) && is_callable( $this->plugins[ $slug ]['is_callable'] ) ) || is_plugin_active( $this->plugins[ $slug ]['file_path'] ) ); + } + + /** + * Check if a plugin can be updated, i.e. if we have information on the minimum WP version required + * available, check whether the current install meets them. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to update, false otherwise. + */ + public function can_plugin_update( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return true; + } + + $api = $this->get_plugins_api( $slug ); + + if ( false !== $api && isset( $api->requires ) ) { + return version_compare( $this->wp_version, $api->requires, '>=' ); + } + + // No usable info received from the plugins API, presume we can update. + return true; + } + + /** + * Check to see if the plugin is 'updatetable', i.e. installed, with an update available + * and no WP version requirements blocking it. + * + * @since 2.6.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to proceed with update, false otherwise. + */ + public function is_plugin_updatetable( $slug ) { + if ( ! $this->is_plugin_installed( $slug ) ) { + return false; + } else { + return ( false !== $this->does_plugin_have_update( $slug ) && $this->can_plugin_update( $slug ) ); + } + } + + /** + * Check if a plugin can be activated, i.e. is not currently active and meets the minimum + * plugin version requirements set in TGMPA (if any). + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True if OK to activate, false otherwise. + */ + public function can_plugin_activate( $slug ) { + return ( ! $this->is_plugin_active( $slug ) && ! $this->does_plugin_require_update( $slug ) ); + } + + /** + * Retrieve the version number of an installed plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string Version number as string or an empty string if the plugin is not installed + * or version unknown (plugins which don't comply with the plugin header standard). + */ + public function get_installed_version( $slug ) { + $installed_plugins = $this->get_plugins(); // Retrieve a list of all installed plugins (WP cached). + + if ( ! empty( $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version'] ) ) { + return $installed_plugins[ $this->plugins[ $slug ]['file_path'] ]['Version']; + } + + return ''; + } + + /** + * Check whether a plugin complies with the minimum version requirements. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return bool True when a plugin needs to be updated, otherwise false. + */ + public function does_plugin_require_update( $slug ) { + $installed_version = $this->get_installed_version( $slug ); + $minimum_version = $this->plugins[ $slug ]['version']; + + return version_compare( $minimum_version, $installed_version, '>' ); + } + + /** + * Check whether there is an update available for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return false|string Version number string of the available update or false if no update available. + */ + public function does_plugin_have_update( $slug ) { + // Presume bundled and external plugins will point to a package which meets the minimum required version. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + if ( $this->does_plugin_require_update( $slug ) ) { + return $this->plugins[ $slug ]['version']; + } + + return false; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( isset( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->new_version; + } + + return false; + } + + /** + * Retrieve potential upgrade notice for a plugin. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string The upgrade notice or an empty string if no message was available or provided. + */ + public function get_upgrade_notice( $slug ) { + // We currently can't get reliable info on non-WP-repo plugins - issue #380. + if ( 'repo' !== $this->plugins[ $slug ]['source_type'] ) { + return ''; + } + + $repo_updates = get_site_transient( 'update_plugins' ); + + if ( ! empty( $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice ) ) { + return $repo_updates->response[ $this->plugins[ $slug ]['file_path'] ]->upgrade_notice; + } + + return ''; + } + + /** + * Wrapper around the core WP get_plugins function, making sure it's actually available. + * + * @since 2.5.0 + * + * @param string $plugin_folder Optional. Relative path to single plugin folder. + * @return array Array of installed plugins with plugin information. + */ + public function get_plugins( $plugin_folder = '' ) { + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + return get_plugins( $plugin_folder ); + } + + /** + * Delete dismissable nag option when theme is switched. + * + * This ensures that the user(s) is/are again reminded via nag of required + * and/or recommended plugins if they re-activate the theme. + * + * @since 2.1.1 + */ + public function update_dismiss() { + delete_metadata( 'user', null, 'tgmpa_dismissed_notice_' . $this->id, null, true ); + } + + /** + * Forces plugin activation if the parameter 'force_activation' is + * set to true. + * + * This allows theme authors to specify certain plugins that must be + * active at all times while using the current theme. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. Setting this parameter + * to true will not allow the specified plugin to be deactivated unless + * the user switches themes. + * + * @since 2.2.0 + */ + public function force_activation() { + foreach ( $this->plugins as $slug => $plugin ) { + if ( true === $plugin['force_activation'] ) { + if ( ! $this->is_plugin_installed( $slug ) ) { + // Oops, plugin isn't there so iterate to next condition. + continue; + } elseif ( $this->can_plugin_activate( $slug ) ) { + // There we go, activate the plugin. + activate_plugin( $plugin['file_path'] ); + } + } + } + } + + /** + * Forces plugin deactivation if the parameter 'force_deactivation' + * is set to true and adds the plugin to the 'recently active' plugins list. + * + * This allows theme authors to specify certain plugins that must be + * deactivated upon switching from the current theme to another. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. + * + * @since 2.2.0 + */ + public function force_deactivation() { + $deactivated = array(); + + foreach ( $this->plugins as $slug => $plugin ) { + /* + * Only proceed forward if the parameter is set to true and plugin is active + * as a 'normal' (not must-use) plugin. + */ + if ( true === $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { + deactivate_plugins( $plugin['file_path'] ); + $deactivated[ $plugin['file_path'] ] = time(); + } + } + + if ( ! empty( $deactivated ) ) { + update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ) ); + } + } + + /** + * Echo the current TGMPA version number to the page. + * + * @since 2.5.0 + */ + public function show_tgmpa_version() { + echo '

    ', + esc_html( + sprintf( + /* translators: %s: version number */ + __( 'TGMPA v%s', 'anaglyph-lite' ), + self::TGMPA_VERSION + ) + ), + '

    '; + } + + /** + * Returns the singleton instance of the class. + * + * @since 2.4.0 + * + * @return \TGM_Plugin_Activation The TGM_Plugin_Activation object. + */ + public static function get_instance() { + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { + self::$instance = new self(); + } + + return self::$instance; + } + } + + if ( ! function_exists( 'load_tgm_plugin_activation' ) ) { + /** + * Ensure only one instance of the class is ever invoked. + * + * @since 2.5.0 + */ + function load_tgm_plugin_activation() { + $GLOBALS['tgmpa'] = TGM_Plugin_Activation::get_instance(); + } + } + + if ( did_action( 'plugins_loaded' ) ) { + load_tgm_plugin_activation(); + } else { + add_action( 'plugins_loaded', 'load_tgm_plugin_activation' ); + } } if ( ! function_exists( 'tgmpa' ) ) { - /** - * Helper function to register a collection of required plugins. - * - * @since 2.0.0 - * @api - * - * @param array $plugins An array of plugin arrays. - * @param array $config Optional. An array of configuration values. - */ - function tgmpa( $plugins, $config = array() ) { - $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - foreach ( $plugins as $plugin ) { - call_user_func( array( $instance, 'register' ), $plugin ); - } - - if ( ! empty( $config ) && is_array( $config ) ) { - // Send out notices for deprecated arguments passed. - if ( isset( $config['notices'] ) ) { - _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); - if ( ! isset( $config['has_notices'] ) ) { - $config['has_notices'] = $config['notices']; - } - } - - if ( isset( $config['parent_menu_slug'] ) ) { - _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); - } - if ( isset( $config['parent_url_slug'] ) ) { - _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); - } - - call_user_func( array( $instance, 'config' ), $config ); - } - } + /** + * Helper function to register a collection of required plugins. + * + * @since 2.0.0 + * @api + * + * @param array $plugins An array of plugin arrays. + * @param array $config Optional. An array of configuration values. + */ + function tgmpa( $plugins, $config = array() ) { + $instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + foreach ( $plugins as $plugin ) { + call_user_func( array( $instance, 'register' ), $plugin ); + } + + if ( ! empty( $config ) && is_array( $config ) ) { + // Send out notices for deprecated arguments passed. + if ( isset( $config['notices'] ) ) { + _deprecated_argument( __FUNCTION__, '2.2.0', 'The `notices` config parameter was renamed to `has_notices` in TGMPA 2.2.0. Please adjust your configuration.' ); + if ( ! isset( $config['has_notices'] ) ) { + $config['has_notices'] = $config['notices']; + } + } + + if ( isset( $config['parent_menu_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_menu_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + if ( isset( $config['parent_url_slug'] ) ) { + _deprecated_argument( __FUNCTION__, '2.4.0', 'The `parent_url_slug` config parameter was removed in TGMPA 2.4.0. In TGMPA 2.5.0 an alternative was (re-)introduced. Please adjust your configuration. For more information visit the website: http://tgmpluginactivation.com/configuration/#h-configuration-options.' ); + } + + call_user_func( array( $instance, 'config' ), $config ); + } + } } /** @@ -1959,956 +2065,980 @@ function tgmpa( $plugins, $config = array() ) { * @since 2.2.0 */ if ( ! class_exists( 'WP_List_Table' ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; + require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php'; } if ( ! class_exists( 'TGMPA_List_Table' ) ) { - /** - * List table class for handling plugins. - * - * Extends the WP_List_Table class to provide a future-compatible - * way of listing out all required/recommended plugins. - * - * Gives users an interface similar to the Plugin Administration - * area with similar (albeit stripped down) capabilities. - * - * This class also allows for the bulk install of plugins. - * - * @since 2.2.0 - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_List_Table extends WP_List_Table { - /** - * TGMPA instance. - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * The currently chosen view. - * - * @since 2.5.0 - * - * @var string One of: 'all', 'install', 'update', 'activate' - */ - public $view_context = 'all'; - - /** - * The plugin counts for the various views. - * - * @since 2.5.0 - * - * @var array - */ - protected $view_totals = array( - 'all' => 0, - 'install' => 0, - 'update' => 0, - 'activate' => 0, - ); - - /** - * References parent constructor and sets defaults for class. - * - * @since 2.2.0 - */ - public function __construct() { - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - parent::__construct( - array( - 'singular' => 'plugin', - 'plural' => 'plugins', - 'ajax' => false, - ) - ); - - if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { - $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); - } - - add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); - } - - /** - * Get a list of CSS classes for the tag. - * - * Overruled to prevent the 'plural' argument from being added. - * - * @since 2.5.0 - * - * @return array CSS classnames. - */ - public function get_table_classes() { - return array( 'widefat', 'fixed' ); - } - - /** - * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. - * - * @since 2.2.0 - * - * @return array $table_data Information for use in table. - */ - protected function _gather_plugin_data() { - // Load thickbox for plugin links. - $this->tgmpa->admin_init(); - $this->tgmpa->thickbox(); - - // Categorize the plugins which have open actions. - $plugins = $this->categorize_plugins_to_views(); - - // Set the counts for the view links. - $this->set_view_totals( $plugins ); - - // Prep variables for use and grab list of all installed plugins. - $table_data = array(); - $i = 0; - - // Redirect to the 'all' view if no plugins were found for the selected view context. - if ( empty( $plugins[ $this->view_context ] ) ) { - $this->view_context = 'all'; - } - - foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { - $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; - $table_data[ $i ]['slug'] = $slug; - $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; - $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); - $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); - $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); - $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); - $table_data[ $i ]['minimum_version'] = $plugin['version']; - $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); - - // Prep the upgrade notice info. - $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); - if ( ! empty( $upgrade_notice ) ) { - $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; - - add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 ); - } - - $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); - - $i++; - } - - return $table_data; - } - - /** - * Categorize the plugins which have open actions into views for the TGMPA page. - * - * @since 2.5.0 - */ - protected function categorize_plugins_to_views() { - $plugins = array( - 'all' => array(), // Meaning: all plugins which still have open actions. - 'install' => array(), - 'update' => array(), - 'activate' => array(), - ); - - foreach ( $this->tgmpa->plugins as $slug => $plugin ) { - if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { - // No need to display plugins if they are installed, up-to-date and active. - continue; - } else { - $plugins['all'][ $slug ] = $plugin; - - if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { - $plugins['install'][ $slug ] = $plugin; - } else { - if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { - $plugins['update'][ $slug ] = $plugin; - } - - if ( $this->tgmpa->can_plugin_activate( $slug ) ) { - $plugins['activate'][ $slug ] = $plugin; - } - } - } - } - - return $plugins; - } - - /** - * Set the counts for the view links. - * - * @since 2.5.0 - * - * @param array $plugins Plugins order by view. - */ - protected function set_view_totals( $plugins ) { - foreach ( $plugins as $type => $list ) { - $this->view_totals[ $type ] = count( $list ); - } - } - - /** - * Get the plugin required/recommended text string. - * - * @since 2.5.0 - * - * @param string $required Plugin required setting. - * @return string - */ - protected function get_plugin_advise_type_text( $required ) { - if ( true === $required ) { - return __( 'Required', 'anaglyph-lite' ); - } - - return __( 'Recommended', 'anaglyph-lite' ); - } - - /** - * Get the plugin source type text string. - * - * @since 2.5.0 - * - * @param string $type Plugin type. - * @return string - */ - protected function get_plugin_source_type_text( $type ) { - $string = ''; - - switch ( $type ) { - case 'repo': - $string = __( 'WordPress Repository', 'anaglyph-lite' ); - break; - case 'external': - $string = __( 'External Source', 'anaglyph-lite' ); - break; - case 'bundled': - $string = __( 'Pre-Packaged', 'anaglyph-lite' ); - break; - } - - return $string; - } - - /** - * Determine the plugin status message. - * - * @since 2.5.0 - * - * @param string $slug Plugin slug. - * @return string - */ - protected function get_plugin_status_text( $slug ) { - if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { - return __( 'Not Installed', 'anaglyph-lite' ); - } - - if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { - $install_status = __( 'Installed But Not Activated', 'anaglyph-lite' ); - } else { - $install_status = __( 'Active', 'anaglyph-lite' ); - } - - $update_status = ''; - - if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { - $update_status = __( 'Required Update not Available', 'anaglyph-lite' ); - - } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { - $update_status = __( 'Requires Update', 'anaglyph-lite' ); - - } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { - $update_status = __( 'Update recommended', 'anaglyph-lite' ); - } - - if ( '' === $update_status ) { - return $install_status; - } - - return sprintf( - _x( '%1$s, %2$s', '%1$s = install status, %2$s = update status', 'anaglyph-lite' ), - $install_status, - $update_status - ); - } - - /** - * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. - * - * @since 2.5.0 - * - * @param array $items Prepared table items. - * @return array Sorted table items. - */ - public function sort_table_items( $items ) { - $type = array(); - $name = array(); - - foreach ( $items as $i => $plugin ) { - $type[ $i ] = $plugin['type']; // Required / recommended. - $name[ $i ] = $plugin['sanitized_plugin']; - } - - array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); - - return $items; - } - - /** - * Get an associative array ( id => link ) of the views available on this table. - * - * @since 2.5.0 - * - * @return array - */ - public function get_views() { - $status_links = array(); - - foreach ( $this->view_totals as $type => $count ) { - if ( $count < 1 ) { - continue; - } - - switch ( $type ) { - case 'all': - $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins', 'anaglyph-lite' ); - break; - case 'install': - $text = _n( 'To Install (%s)', 'To Install (%s)', $count, 'anaglyph-lite' ); - break; - case 'update': - $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count, 'anaglyph-lite' ); - break; - case 'activate': - $text = _n( 'To Activate (%s)', 'To Activate (%s)', $count, 'anaglyph-lite' ); - break; - default: - $text = ''; - break; - } - - if ( ! empty( $text ) ) { - - $status_links[ $type ] = sprintf( - '%s', - esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), - ( $type === $this->view_context ) ? ' class="current"' : '', - sprintf( $text, number_format_i18n( $count ) ) - ); - } - } - - return $status_links; - } - - /** - * Create default columns to display important plugin information - * like type, action and status. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @param string $column_name The name of the column. - * @return string - */ - public function column_default( $item, $column_name ) { - return $item[ $column_name ]; - } - - /** - * Required for bulk installing. - * - * Adds a checkbox for each plugin. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @return string The input checkbox with all necessary info. - */ - public function column_cb( $item ) { - return sprintf( - '', - esc_attr( $this->_args['singular'] ), - esc_attr( $item['slug'] ), - esc_attr( $item['sanitized_plugin'] ) - ); - } - - /** - * Create default title column along with the action links. - * - * @since 2.2.0 - * - * @param array $item Array of item data. - * @return string The plugin name and action links. - */ - public function column_plugin( $item ) { - return sprintf( - '%1$s %2$s', - $item['plugin'], - $this->row_actions( $this->get_row_actions( $item ), true ) - ); - } - - /** - * Create version information column. - * - * @since 2.5.0 - * - * @param array $item Array of item data. - * @return string HTML-formatted version information. - */ - public function column_version( $item ) { - $output = array(); - - if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { - $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'anaglyph-lite' ); - - $color = ''; - if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { - $color = ' color: #ff0000; font-weight: bold;'; - } - - $output[] = sprintf( - '

    %2$s' . __( 'Installed version:', 'anaglyph-lite' ) . '

    ', - $color, - $installed - ); - } - - if ( ! empty( $item['minimum_version'] ) ) { - $output[] = sprintf( - '

    %1$s' . __( 'Minimum required version:', 'anaglyph-lite' ) . '

    ', - $item['minimum_version'] - ); - } - - if ( ! empty( $item['available_version'] ) ) { - $color = ''; - if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { - $color = ' color: #71C671; font-weight: bold;'; - } - - $output[] = sprintf( - '

    %2$s' . __( 'Available version:', 'anaglyph-lite' ) . '

    ', - $color, - $item['available_version'] - ); - } - - if ( empty( $output ) ) { - return ' '; // Let's not break the table layout. - } else { - return implode( "\n", $output ); - } - } - - /** - * Sets default message within the plugins table if no plugins - * are left for interaction. - * - * Hides the menu item to prevent the user from clicking and - * getting a permissions error. - * - * @since 2.2.0 - */ - public function no_items() { - printf( wp_kses_post( __( 'No plugins to install, update or activate. Return to the Dashboard', 'anaglyph-lite' ) ), esc_url( self_admin_url() ) ); - echo ''; - } - - /** - * Output all the column information within the table. - * - * @since 2.2.0 - * - * @return array $columns The column names. - */ - public function get_columns() { - $columns = array( - 'cb' => '', - 'plugin' => __( 'Plugin', 'anaglyph-lite' ), - 'source' => __( 'Source', 'anaglyph-lite' ), - 'type' => __( 'Type', 'anaglyph-lite' ), - ); - - if ( 'all' === $this->view_context || 'update' === $this->view_context ) { - $columns['version'] = __( 'Version', 'anaglyph-lite' ); - $columns['status'] = __( 'Status', 'anaglyph-lite' ); - } - - return apply_filters( 'tgmpa_table_columns', $columns ); - } - - /** - * Get name of default primary column - * - * @since 2.5.0 / WP 4.3+ compatibility - * @access protected - * - * @return string - */ - protected function get_default_primary_column_name() { - return 'plugin'; - } - - /** - * Get the name of the primary column. - * - * @since 2.5.0 / WP 4.3+ compatibility - * @access protected - * - * @return string The name of the primary column. - */ - protected function get_primary_column_name() { - if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { - return parent::get_primary_column_name(); - } else { - return $this->get_default_primary_column_name(); - } - } - - /** - * Get the actions which are relevant for a specific plugin row. - * - * @since 2.5.0 - * - * @param array $item Array of item data. - * @return array Array with relevant action links. - */ - protected function get_row_actions( $item ) { - $actions = array(); - $action_links = array(); - - // Display the 'Install' action link if the plugin is not yet available. - if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { - $actions['install'] = _x( 'Install %2$s', '%2$s = plugin name in screen reader markup', 'anaglyph-lite' ); - } else { - // Display the 'Update' action link if an update is available and WP complies with plugin minimum. - if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { - $actions['update'] = _x( 'Update %2$s', '%2$s = plugin name in screen reader markup', 'anaglyph-lite' ); - } - - // Display the 'Activate' action link, but only if the plugin meets the minimum version. - if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { - $actions['activate'] = _x( 'Activate %2$s', '%2$s = plugin name in screen reader markup', 'anaglyph-lite' ); - } - } - - // Create the actual links. - foreach ( $actions as $action => $text ) { - $nonce_url = wp_nonce_url( - add_query_arg( - array( - 'plugin' => urlencode( $item['slug'] ), - 'tgmpa-' . $action => $action . '-plugin', - ), - $this->tgmpa->get_tgmpa_url() - ), - 'tgmpa-' . $action, - 'tgmpa-nonce' - ); - - $action_links[ $action ] = sprintf( - '' . esc_html( $text ) . '', - esc_url( $nonce_url ), - '' . esc_html( $item['sanitized_plugin'] ) . '' - ); - } - - $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; - return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); - } - - /** - * Generates content for a single row of the table. - * - * @since 2.5.0 - * - * @param object $item The current item. - */ - public function single_row( $item ) { - parent::single_row( $item ); - - /** - * Fires after each specific row in the TGMPA Plugins list table. - * - * The dynamic portion of the hook name, `$item['slug']`, refers to the slug - * for the plugin. - * - * @since 2.5.0 - */ - do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); - } - - /** - * Show the upgrade notice below a plugin row if there is one. - * - * @since 2.5.0 - * - * @see /wp-admin/includes/update.php - * - * @param string $slug Plugin slug. - * @param array $item The information available in this table row. - * @return null Return early if upgrade notice is empty. - */ - public function wp_plugin_update_row( $slug, $item ) { - if ( empty( $item['upgrade_notice'] ) ) { - return; - } - - echo ' + /** + * List table class for handling plugins. + * + * Extends the WP_List_Table class to provide a future-compatible + * way of listing out all required/recommended plugins. + * + * Gives users an interface similar to the Plugin Administration + * area with similar (albeit stripped down) capabilities. + * + * This class also allows for the bulk install of plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_List_Table extends WP_List_Table { + /** + * TGMPA instance. + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * The currently chosen view. + * + * @since 2.5.0 + * + * @var string One of: 'all', 'install', 'update', 'activate' + */ + public $view_context = 'all'; + + /** + * The plugin counts for the various views. + * + * @since 2.5.0 + * + * @var array + */ + protected $view_totals = array( + 'all' => 0, + 'install' => 0, + 'update' => 0, + 'activate' => 0, + ); + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + */ + public function __construct() { + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( + array( + 'singular' => 'plugin', + 'plural' => 'plugins', + 'ajax' => false, + ) + ); + + if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'install', 'update', 'activate' ), true ) ) { + $this->view_context = sanitize_key( $_REQUEST['plugin_status'] ); + } + + add_filter( 'tgmpa_table_data_items', array( $this, 'sort_table_items' ) ); + } + + /** + * Get a list of CSS classes for the
    tag. + * + * Overruled to prevent the 'plural' argument from being added. + * + * @since 2.5.0 + * + * @return array CSS classnames. + */ + public function get_table_classes() { + return array( 'widefat', 'fixed' ); + } + + /** + * Gathers and renames all of our plugin information to be used by WP_List_Table to create our table. + * + * @since 2.2.0 + * + * @return array $table_data Information for use in table. + */ + protected function _gather_plugin_data() { + // Load thickbox for plugin links. + $this->tgmpa->admin_init(); + $this->tgmpa->thickbox(); + + // Categorize the plugins which have open actions. + $plugins = $this->categorize_plugins_to_views(); + + // Set the counts for the view links. + $this->set_view_totals( $plugins ); + + // Prep variables for use and grab list of all installed plugins. + $table_data = array(); + $i = 0; + + // Redirect to the 'all' view if no plugins were found for the selected view context. + if ( empty( $plugins[ $this->view_context ] ) ) { + $this->view_context = 'all'; + } + + foreach ( $plugins[ $this->view_context ] as $slug => $plugin ) { + $table_data[ $i ]['sanitized_plugin'] = $plugin['name']; + $table_data[ $i ]['slug'] = $slug; + $table_data[ $i ]['plugin'] = '' . $this->tgmpa->get_info_link( $slug ) . ''; + $table_data[ $i ]['source'] = $this->get_plugin_source_type_text( $plugin['source_type'] ); + $table_data[ $i ]['type'] = $this->get_plugin_advise_type_text( $plugin['required'] ); + $table_data[ $i ]['status'] = $this->get_plugin_status_text( $slug ); + $table_data[ $i ]['installed_version'] = $this->tgmpa->get_installed_version( $slug ); + $table_data[ $i ]['minimum_version'] = $plugin['version']; + $table_data[ $i ]['available_version'] = $this->tgmpa->does_plugin_have_update( $slug ); + + // Prep the upgrade notice info. + $upgrade_notice = $this->tgmpa->get_upgrade_notice( $slug ); + if ( ! empty( $upgrade_notice ) ) { + $table_data[ $i ]['upgrade_notice'] = $upgrade_notice; + + add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 ); + } + + $table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin ); + + $i++; + } + + return $table_data; + } + + /** + * Categorize the plugins which have open actions into views for the TGMPA page. + * + * @since 2.5.0 + */ + protected function categorize_plugins_to_views() { + $plugins = array( + 'all' => array(), // Meaning: all plugins which still have open actions. + 'install' => array(), + 'update' => array(), + 'activate' => array(), + ); + + foreach ( $this->tgmpa->plugins as $slug => $plugin ) { + if ( $this->tgmpa->is_plugin_active( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { + // No need to display plugins if they are installed, up-to-date and active. + continue; + } else { + $plugins['all'][ $slug ] = $plugin; + + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + $plugins['install'][ $slug ] = $plugin; + } else { + if ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $plugins['update'][ $slug ] = $plugin; + } + + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins['activate'][ $slug ] = $plugin; + } + } + } + } + + return $plugins; + } + + /** + * Set the counts for the view links. + * + * @since 2.5.0 + * + * @param array $plugins Plugins order by view. + */ + protected function set_view_totals( $plugins ) { + foreach ( $plugins as $type => $list ) { + $this->view_totals[ $type ] = count( $list ); + } + } + + /** + * Get the plugin required/recommended text string. + * + * @since 2.5.0 + * + * @param string $required Plugin required setting. + * @return string + */ + protected function get_plugin_advise_type_text( $required ) { + if ( true === $required ) { + return __( 'Required', 'anaglyph-lite' ); + } + + return __( 'Recommended', 'anaglyph-lite' ); + } + + /** + * Get the plugin source type text string. + * + * @since 2.5.0 + * + * @param string $type Plugin type. + * @return string + */ + protected function get_plugin_source_type_text( $type ) { + $string = ''; + + switch ( $type ) { + case 'repo': + $string = __( 'WordPress Repository', 'anaglyph-lite' ); + break; + case 'external': + $string = __( 'External Source', 'anaglyph-lite' ); + break; + case 'bundled': + $string = __( 'Pre-Packaged', 'anaglyph-lite' ); + break; + } + + return $string; + } + + /** + * Determine the plugin status message. + * + * @since 2.5.0 + * + * @param string $slug Plugin slug. + * @return string + */ + protected function get_plugin_status_text( $slug ) { + if ( ! $this->tgmpa->is_plugin_installed( $slug ) ) { + return __( 'Not Installed', 'anaglyph-lite' ); + } + + if ( ! $this->tgmpa->is_plugin_active( $slug ) ) { + $install_status = __( 'Installed But Not Activated', 'anaglyph-lite' ); + } else { + $install_status = __( 'Active', 'anaglyph-lite' ); + } + + $update_status = ''; + + if ( $this->tgmpa->does_plugin_require_update( $slug ) && false === $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Required Update not Available', 'anaglyph-lite' ); + + } elseif ( $this->tgmpa->does_plugin_require_update( $slug ) ) { + $update_status = __( 'Requires Update', 'anaglyph-lite' ); + + } elseif ( false !== $this->tgmpa->does_plugin_have_update( $slug ) ) { + $update_status = __( 'Update recommended', 'anaglyph-lite' ); + } + + if ( '' === $update_status ) { + return $install_status; + } + + return sprintf( + /* translators: 1: install status, 2: update status */ + _x( '%1$s, %2$s', 'Install/Update Status', 'anaglyph-lite' ), + $install_status, + $update_status + ); + } + + /** + * Sort plugins by Required/Recommended type and by alphabetical plugin name within each type. + * + * @since 2.5.0 + * + * @param array $items Prepared table items. + * @return array Sorted table items. + */ + public function sort_table_items( $items ) { + $type = array(); + $name = array(); + + foreach ( $items as $i => $plugin ) { + $type[ $i ] = $plugin['type']; // Required / recommended. + $name[ $i ] = $plugin['sanitized_plugin']; + } + + array_multisort( $type, SORT_DESC, $name, SORT_ASC, $items ); + + return $items; + } + + /** + * Get an associative array ( id => link ) of the views available on this table. + * + * @since 2.5.0 + * + * @return array + */ + public function get_views() { + $status_links = array(); + + foreach ( $this->view_totals as $type => $count ) { + if ( $count < 1 ) { + continue; + } + + switch ( $type ) { + case 'all': + /* translators: 1: number of plugins. */ + $text = _nx( 'All (%s)', 'All (%s)', $count, 'plugins', 'anaglyph-lite' ); + break; + case 'install': + /* translators: 1: number of plugins. */ + $text = _n( 'To Install (%s)', 'To Install (%s)', $count, 'anaglyph-lite' ); + break; + case 'update': + /* translators: 1: number of plugins. */ + $text = _n( 'Update Available (%s)', 'Update Available (%s)', $count, 'anaglyph-lite' ); + break; + case 'activate': + /* translators: 1: number of plugins. */ + $text = _n( 'To Activate (%s)', 'To Activate (%s)', $count, 'anaglyph-lite' ); + break; + default: + $text = ''; + break; + } + + if ( ! empty( $text ) ) { + + $status_links[ $type ] = sprintf( + '%s', + esc_url( $this->tgmpa->get_tgmpa_status_url( $type ) ), + ( $type === $this->view_context ) ? ' class="current"' : '', + sprintf( $text, number_format_i18n( $count ) ) + ); + } + } + + return $status_links; + } + + /** + * Create default columns to display important plugin information + * like type, action and status. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @param string $column_name The name of the column. + * @return string + */ + public function column_default( $item, $column_name ) { + return $item[ $column_name ]; + } + + /** + * Required for bulk installing. + * + * Adds a checkbox for each plugin. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The input checkbox with all necessary info. + */ + public function column_cb( $item ) { + return sprintf( + '', + esc_attr( $this->_args['singular'] ), + esc_attr( $item['slug'] ), + esc_attr( $item['sanitized_plugin'] ) + ); + } + + /** + * Create default title column along with the action links. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The plugin name and action links. + */ + public function column_plugin( $item ) { + return sprintf( + '%1$s %2$s', + $item['plugin'], + $this->row_actions( $this->get_row_actions( $item ), true ) + ); + } + + /** + * Create version information column. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return string HTML-formatted version information. + */ + public function column_version( $item ) { + $output = array(); + + if ( $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + $installed = ! empty( $item['installed_version'] ) ? $item['installed_version'] : _x( 'unknown', 'as in: "version nr unknown"', 'anaglyph-lite' ); + + $color = ''; + if ( ! empty( $item['minimum_version'] ) && $this->tgmpa->does_plugin_require_update( $item['slug'] ) ) { + $color = ' color: #ff0000; font-weight: bold;'; + } + + $output[] = sprintf( + '

    %2$s' . __( 'Installed version:', 'anaglyph-lite' ) . '

    ', + $color, + $installed + ); + } + + if ( ! empty( $item['minimum_version'] ) ) { + $output[] = sprintf( + '

    %1$s' . __( 'Minimum required version:', 'anaglyph-lite' ) . '

    ', + $item['minimum_version'] + ); + } + + if ( ! empty( $item['available_version'] ) ) { + $color = ''; + if ( ! empty( $item['minimum_version'] ) && version_compare( $item['available_version'], $item['minimum_version'], '>=' ) ) { + $color = ' color: #71C671; font-weight: bold;'; + } + + $output[] = sprintf( + '

    %2$s' . __( 'Available version:', 'anaglyph-lite' ) . '

    ', + $color, + $item['available_version'] + ); + } + + if ( empty( $output ) ) { + return ' '; // Let's not break the table layout. + } else { + return implode( "\n", $output ); + } + } + + /** + * Sets default message within the plugins table if no plugins + * are left for interaction. + * + * Hides the menu item to prevent the user from clicking and + * getting a permissions error. + * + * @since 2.2.0 + */ + public function no_items() { + echo esc_html__( 'No plugins to install, update or activate.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Return to the Dashboard', 'anaglyph-lite' ) . ''; + echo ''; + } + + /** + * Output all the column information within the table. + * + * @since 2.2.0 + * + * @return array $columns The column names. + */ + public function get_columns() { + $columns = array( + 'cb' => '', + 'plugin' => __( 'Plugin', 'anaglyph-lite' ), + 'source' => __( 'Source', 'anaglyph-lite' ), + 'type' => __( 'Type', 'anaglyph-lite' ), + ); + + if ( 'all' === $this->view_context || 'update' === $this->view_context ) { + $columns['version'] = __( 'Version', 'anaglyph-lite' ); + $columns['status'] = __( 'Status', 'anaglyph-lite' ); + } + + return apply_filters( 'tgmpa_table_columns', $columns ); + } + + /** + * Get name of default primary column + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string + */ + protected function get_default_primary_column_name() { + return 'plugin'; + } + + /** + * Get the name of the primary column. + * + * @since 2.5.0 / WP 4.3+ compatibility + * @access protected + * + * @return string The name of the primary column. + */ + protected function get_primary_column_name() { + if ( method_exists( 'WP_List_Table', 'get_primary_column_name' ) ) { + return parent::get_primary_column_name(); + } else { + return $this->get_default_primary_column_name(); + } + } + + /** + * Get the actions which are relevant for a specific plugin row. + * + * @since 2.5.0 + * + * @param array $item Array of item data. + * @return array Array with relevant action links. + */ + protected function get_row_actions( $item ) { + $actions = array(); + $action_links = array(); + + // Display the 'Install' action link if the plugin is not yet available. + if ( ! $this->tgmpa->is_plugin_installed( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['install'] = __( 'Install %2$s', 'anaglyph-lite' ); + } else { + // Display the 'Update' action link if an update is available and WP complies with plugin minimum. + if ( false !== $this->tgmpa->does_plugin_have_update( $item['slug'] ) && $this->tgmpa->can_plugin_update( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['update'] = __( 'Update %2$s', 'anaglyph-lite' ); + } + + // Display the 'Activate' action link, but only if the plugin meets the minimum version. + if ( $this->tgmpa->can_plugin_activate( $item['slug'] ) ) { + /* translators: %2$s: plugin name in screen reader markup */ + $actions['activate'] = __( 'Activate %2$s', 'anaglyph-lite' ); + } + } + + // Create the actual links. + foreach ( $actions as $action => $text ) { + $nonce_url = wp_nonce_url( + add_query_arg( + array( + 'plugin' => urlencode( $item['slug'] ), + 'tgmpa-' . $action => $action . '-plugin', + ), + $this->tgmpa->get_tgmpa_url() + ), + 'tgmpa-' . $action, + 'tgmpa-nonce' + ); + + $action_links[ $action ] = sprintf( + '' . esc_html( $text ) . '', // $text contains the second placeholder. + esc_url( $nonce_url ), + '' . esc_html( $item['sanitized_plugin'] ) . '' + ); + } + + $prefix = ( defined( 'WP_NETWORK_ADMIN' ) && WP_NETWORK_ADMIN ) ? 'network_admin_' : ''; + return apply_filters( "tgmpa_{$prefix}plugin_action_links", array_filter( $action_links ), $item['slug'], $item, $this->view_context ); + } + + /** + * Generates content for a single row of the table. + * + * @since 2.5.0 + * + * @param object $item The current item. + */ + public function single_row( $item ) { + parent::single_row( $item ); + + /** + * Fires after each specific row in the TGMPA Plugins list table. + * + * The dynamic portion of the hook name, `$item['slug']`, refers to the slug + * for the plugin. + * + * @since 2.5.0 + */ + do_action( "tgmpa_after_plugin_row_{$item['slug']}", $item['slug'], $item, $this->view_context ); + } + + /** + * Show the upgrade notice below a plugin row if there is one. + * + * @since 2.5.0 + * + * @see /wp-admin/includes/update.php + * + * @param string $slug Plugin slug. + * @param array $item The information available in this table row. + * @return null Return early if upgrade notice is empty. + */ + public function wp_plugin_update_row( $slug, $item ) { + if ( empty( $item['upgrade_notice'] ) ) { + return; + } + + echo ' '; - } - - /** - * Extra controls to be displayed between bulk actions and pagination. - * - * @since 2.5.0 - * - * @param string $which 'top' or 'bottom' table navigation. - */ - public function extra_tablenav( $which ) { - if ( 'bottom' === $which ) { - $this->tgmpa->show_tgmpa_version(); - } - } - - /** - * Defines the bulk actions for handling registered plugins. - * - * @since 2.2.0 - * - * @return array $actions The bulk actions for the plugin install table. - */ - public function get_bulk_actions() { - - $actions = array(); - - if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { - if ( current_user_can( 'install_plugins' ) ) { - $actions['tgmpa-bulk-install'] = __( 'Install', 'anaglyph-lite' ); - } - } - - if ( 'install' !== $this->view_context ) { - if ( current_user_can( 'update_plugins' ) ) { - $actions['tgmpa-bulk-update'] = __( 'Update', 'anaglyph-lite' ); - } - if ( current_user_can( 'activate_plugins' ) ) { - $actions['tgmpa-bulk-activate'] = __( 'Activate', 'anaglyph-lite' ); - } - } - - return $actions; - } - - /** - * Processes bulk installation and activation actions. - * - * The bulk installation process looks for the $_POST information and passes that - * through if a user has to use WP_Filesystem to enter their credentials. - * - * @since 2.2.0 - */ - public function process_bulk_actions() { - // Bulk installation process. - if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { - - check_admin_referer( 'bulk-' . $this->_args['plural'] ); - - $install_type = 'install'; - if ( 'tgmpa-bulk-update' === $this->current_action() ) { - $install_type = 'update'; - } - - $plugins_to_install = array(); - - // Did user actually select any plugins to install/update ? - if ( empty( $_POST['plugin'] ) ) { - if ( 'install' === $install_type ) { - $message = __( 'No plugins were selected to be installed. No action taken.', 'anaglyph-lite' ); - } else { - $message = __( 'No plugins were selected to be updated. No action taken.', 'anaglyph-lite' ); - } - - echo '

    ', esc_html( $message ), '

    '; - - return false; - } - - if ( is_array( $_POST['plugin'] ) ) { - $plugins_to_install = (array) $_POST['plugin']; - } elseif ( is_string( $_POST['plugin'] ) ) { - // Received via Filesystem page - un-flatten array (WP bug #19643). - $plugins_to_install = explode( ',', $_POST['plugin'] ); - } - - // Sanitize the received input. - $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); - $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); - - // Validate the received input. - foreach ( $plugins_to_install as $key => $slug ) { - // Check if the plugin was registered with TGMPA and remove if not. - if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { - unset( $plugins_to_install[ $key ] ); - continue; - } - - // For updates: make sure this is a plugin we *can* update (update available and WP version ok). - if ( 'update' === $install_type && ( $this->tgmpa->is_plugin_installed( $slug ) && ( false === $this->tgmpa->does_plugin_have_update( $slug ) || ! $this->tgmpa->can_plugin_update( $slug ) ) ) ) { - unset( $plugins_to_install[ $key ] ); - } - } - - // No need to proceed further if we have no plugins to handle. - if ( empty( $plugins_to_install ) ) { - if ( 'install' === $install_type ) { - $message = __( 'No plugins are available to be installed at this time.', 'anaglyph-lite' ); - } else { - $message = __( 'No plugins are available to be updated at this time.', 'anaglyph-lite' ); - } - - echo '

    ', esc_html( $message ), '

    '; - - return false; - } - - // Pass all necessary information if WP_Filesystem is needed. - $url = wp_nonce_url( - $this->tgmpa->get_tgmpa_url(), - 'bulk-' . $this->_args['plural'] - ); - - // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. - $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. - - $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. - $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. - - if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { - return true; // Stop the normal page form from displaying, credential request form will be shown. - } - - // Now we have some credentials, setup WP_Filesystem. - if ( ! WP_Filesystem( $creds ) ) { - // Our credentials were no good, ask the user for them again. - request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); - - return true; - } - - /* If we arrive here, we have the filesystem */ - - // Store all information in arrays since we are processing a bulk installation. - $names = array(); - $sources = array(); // Needed for installs. - $file_paths = array(); // Needed for upgrades. - $to_inject = array(); // Information to inject into the update_plugins transient. - - // Prepare the data for validated plugins for the install/upgrade. - foreach ( $plugins_to_install as $slug ) { - $name = $this->tgmpa->plugins[ $slug ]['name']; - $source = $this->tgmpa->get_download_url( $slug ); - - if ( ! empty( $name ) && ! empty( $source ) ) { - $names[] = $name; - - switch ( $install_type ) { - - case 'install': - $sources[] = $source; - break; - - case 'update': - $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; - $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; - $to_inject[ $slug ]['source'] = $source; - break; - } - } - } - unset( $slug, $name, $source ); - - // Create a new instance of TGMPA_Bulk_Installer. - $installer = new TGMPA_Bulk_Installer( - new TGMPA_Bulk_Installer_Skin( - array( - 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), - 'nonce' => 'bulk-' . $this->_args['plural'], - 'names' => $names, - 'install_type' => $install_type, - ) - ) - ); - - // Wrap the install process with the appropriate HTML. - echo '
    ', - '

    ', esc_html( get_admin_page_title() ), '

    '; - - // Process the bulk installation submissions. - add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); - - if ( 'tgmpa-bulk-update' === $this->current_action() ) { - // Inject our info into the update transient. - $this->tgmpa->inject_update_info( $to_inject ); - - $installer->bulk_upgrade( $file_paths ); - } else { - $installer->bulk_install( $sources ); - } - - remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); - - echo '
    '; - - return true; - } - - // Bulk activation process. - if ( 'tgmpa-bulk-activate' === $this->current_action() ) { - check_admin_referer( 'bulk-' . $this->_args['plural'] ); - - // Did user actually select any plugins to activate ? - if ( empty( $_POST['plugin'] ) ) { - echo '

    ', esc_html__( 'No plugins were selected to be activated. No action taken.', 'anaglyph-lite' ), '

    '; - - return false; - } - - // Grab plugin data from $_POST. - $plugins = array(); - if ( isset( $_POST['plugin'] ) ) { - $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); - $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); - } - - $plugins_to_activate = array(); - $plugin_names = array(); - - // Grab the file paths for the selected & inactive plugins from the registration array. - foreach ( $plugins as $slug ) { - if ( $this->tgmpa->can_plugin_activate( $slug ) ) { - $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; - $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; - } - } - unset( $slug ); - - // Return early if there are no plugins to activate. - if ( empty( $plugins_to_activate ) ) { - echo '

    ', esc_html__( 'No plugins are available to be activated at this time.', 'anaglyph-lite' ), '

    '; - - return false; - } - - // Now we are good to go - let's start activating plugins. - $activate = activate_plugins( $plugins_to_activate ); - - if ( is_wp_error( $activate ) ) { - echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    '; - } else { - $count = count( $plugin_names ); // Count so we can use _n function. - $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); - $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. - $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'anaglyph-lite' ) . ' ' . $last_plugin ); - - printf( // WPCS: xss ok. - '

    %1$s %2$s.

    ', - esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'anaglyph-lite' ) ), - $imploded - ); - - // Update recently activated plugins option. - $recent = (array) get_option( 'recently_activated' ); - foreach ( $plugins_to_activate as $plugin => $time ) { - if ( isset( $recent[ $plugin ] ) ) { - unset( $recent[ $plugin ] ); - } - } - update_option( 'recently_activated', $recent ); - } - - unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. - - return true; - } - - return false; - } - - /** - * Prepares all of our information to be outputted into a usable table. - * - * @since 2.2.0 - */ - public function prepare_items() { - $columns = $this->get_columns(); // Get all necessary column information. - $hidden = array(); // No columns to hide, but we must set as an array. - $sortable = array(); // No reason to make sortable columns. - $primary = $this->get_primary_column_name(); // Column which has the row actions. - $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. - - // Process our bulk activations here. - if ( 'tgmpa-bulk-activate' === $this->current_action() ) { - $this->process_bulk_actions(); - } - - // Store all of our plugin data into $items array so WP_List_Table can use it. - $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); - } - - /* *********** DEPRECATED METHODS *********** */ - - /** - * Retrieve plugin data, given the plugin name. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. - * @see TGM_Plugin_Activation::_get_plugin_data_from_name() - * - * @param string $name Name of the plugin, as it was registered. - * @param string $data Optional. Array key of plugin data to return. Default is slug. - * @return string|boolean Plugin slug if found, false otherwise. - */ - protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); - - return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); - } - } + } + + /** + * Extra controls to be displayed between bulk actions and pagination. + * + * @since 2.5.0 + * + * @param string $which 'top' or 'bottom' table navigation. + */ + public function extra_tablenav( $which ) { + if ( 'bottom' === $which ) { + $this->tgmpa->show_tgmpa_version(); + } + } + + /** + * Defines the bulk actions for handling registered plugins. + * + * @since 2.2.0 + * + * @return array $actions The bulk actions for the plugin install table. + */ + public function get_bulk_actions() { + + $actions = array(); + + if ( 'update' !== $this->view_context && 'activate' !== $this->view_context ) { + if ( current_user_can( 'install_plugins' ) ) { + $actions['tgmpa-bulk-install'] = __( 'Install', 'anaglyph-lite' ); + } + } + + if ( 'install' !== $this->view_context ) { + if ( current_user_can( 'update_plugins' ) ) { + $actions['tgmpa-bulk-update'] = __( 'Update', 'anaglyph-lite' ); + } + if ( current_user_can( 'activate_plugins' ) ) { + $actions['tgmpa-bulk-activate'] = __( 'Activate', 'anaglyph-lite' ); + } + } + + return $actions; + } + + /** + * Processes bulk installation and activation actions. + * + * The bulk installation process looks for the $_POST information and passes that + * through if a user has to use WP_Filesystem to enter their credentials. + * + * @since 2.2.0 + */ + public function process_bulk_actions() { + // Bulk installation process. + if ( 'tgmpa-bulk-install' === $this->current_action() || 'tgmpa-bulk-update' === $this->current_action() ) { + + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + $install_type = 'install'; + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + $install_type = 'update'; + } + + $plugins_to_install = array(); + + // Did user actually select any plugins to install/update ? + if ( empty( $_POST['plugin'] ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins were selected to be installed. No action taken.', 'anaglyph-lite' ); + } else { + $message = __( 'No plugins were selected to be updated. No action taken.', 'anaglyph-lite' ); + } + + echo '

    ', esc_html( $message ), '

    '; + + return false; + } + + if ( is_array( $_POST['plugin'] ) ) { + $plugins_to_install = (array) $_POST['plugin']; + } elseif ( is_string( $_POST['plugin'] ) ) { + // Received via Filesystem page - un-flatten array (WP bug #19643). + $plugins_to_install = explode( ',', $_POST['plugin'] ); + } + + // Sanitize the received input. + $plugins_to_install = array_map( 'urldecode', $plugins_to_install ); + $plugins_to_install = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins_to_install ); + + // Validate the received input. + foreach ( $plugins_to_install as $key => $slug ) { + // Check if the plugin was registered with TGMPA and remove if not. + if ( ! isset( $this->tgmpa->plugins[ $slug ] ) ) { + unset( $plugins_to_install[ $key ] ); + continue; + } + + // For install: make sure this is a plugin we *can* install and not one already installed. + if ( 'install' === $install_type && true === $this->tgmpa->is_plugin_installed( $slug ) ) { + unset( $plugins_to_install[ $key ] ); + } + + // For updates: make sure this is a plugin we *can* update (update available and WP version ok). + if ( 'update' === $install_type && false === $this->tgmpa->is_plugin_updatetable( $slug ) ) { + unset( $plugins_to_install[ $key ] ); + } + } + + // No need to proceed further if we have no plugins to handle. + if ( empty( $plugins_to_install ) ) { + if ( 'install' === $install_type ) { + $message = __( 'No plugins are available to be installed at this time.', 'anaglyph-lite' ); + } else { + $message = __( 'No plugins are available to be updated at this time.', 'anaglyph-lite' ); + } + + echo '

    ', esc_html( $message ), '

    '; + + return false; + } + + // Pass all necessary information if WP_Filesystem is needed. + $url = wp_nonce_url( + $this->tgmpa->get_tgmpa_url(), + 'bulk-' . $this->_args['plural'] + ); + + // Give validated data back to $_POST which is the only place the filesystem looks for extra fields. + $_POST['plugin'] = implode( ',', $plugins_to_install ); // Work around for WP bug #19643. + + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + $fields = array_keys( $_POST ); // Extra fields to pass to WP_Filesystem. + + if ( false === ( $creds = request_filesystem_credentials( esc_url_raw( $url ), $method, false, false, $fields ) ) ) { + return true; // Stop the normal page form from displaying, credential request form will be shown. + } + + // Now we have some credentials, setup WP_Filesystem. + if ( ! WP_Filesystem( $creds ) ) { + // Our credentials were no good, ask the user for them again. + request_filesystem_credentials( esc_url_raw( $url ), $method, true, false, $fields ); + + return true; + } + + /* If we arrive here, we have the filesystem */ + + // Store all information in arrays since we are processing a bulk installation. + $names = array(); + $sources = array(); // Needed for installs. + $file_paths = array(); // Needed for upgrades. + $to_inject = array(); // Information to inject into the update_plugins transient. + + // Prepare the data for validated plugins for the install/upgrade. + foreach ( $plugins_to_install as $slug ) { + $name = $this->tgmpa->plugins[ $slug ]['name']; + $source = $this->tgmpa->get_download_url( $slug ); + + if ( ! empty( $name ) && ! empty( $source ) ) { + $names[] = $name; + + switch ( $install_type ) { + + case 'install': + $sources[] = $source; + break; + + case 'update': + $file_paths[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $to_inject[ $slug ] = $this->tgmpa->plugins[ $slug ]; + $to_inject[ $slug ]['source'] = $source; + break; + } + } + } + unset( $slug, $name, $source ); + + // Create a new instance of TGMPA_Bulk_Installer. + $installer = new TGMPA_Bulk_Installer( + new TGMPA_Bulk_Installer_Skin( + array( + 'url' => esc_url_raw( $this->tgmpa->get_tgmpa_url() ), + 'nonce' => 'bulk-' . $this->_args['plural'], + 'names' => $names, + 'install_type' => $install_type, + ) + ) + ); + + // Wrap the install process with the appropriate HTML. + echo '
    ', + '

    ', esc_html( get_admin_page_title() ), '

    +
    '; + + // Process the bulk installation submissions. + add_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1, 3 ); + + if ( 'tgmpa-bulk-update' === $this->current_action() ) { + // Inject our info into the update transient. + $this->tgmpa->inject_update_info( $to_inject ); + + $installer->bulk_upgrade( $file_paths ); + } else { + $installer->bulk_install( $sources ); + } + + remove_filter( 'upgrader_source_selection', array( $this->tgmpa, 'maybe_adjust_source_dir' ), 1 ); + + echo '
    '; + + return true; + } + + // Bulk activation process. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + // Did user actually select any plugins to activate ? + if ( empty( $_POST['plugin'] ) ) { + echo '

    ', esc_html__( 'No plugins were selected to be activated. No action taken.', 'anaglyph-lite' ), '

    '; + + return false; + } + + // Grab plugin data from $_POST. + $plugins = array(); + if ( isset( $_POST['plugin'] ) ) { + $plugins = array_map( 'urldecode', (array) $_POST['plugin'] ); + $plugins = array_map( array( $this->tgmpa, 'sanitize_key' ), $plugins ); + } + + $plugins_to_activate = array(); + $plugin_names = array(); + + // Grab the file paths for the selected & inactive plugins from the registration array. + foreach ( $plugins as $slug ) { + if ( $this->tgmpa->can_plugin_activate( $slug ) ) { + $plugins_to_activate[] = $this->tgmpa->plugins[ $slug ]['file_path']; + $plugin_names[] = $this->tgmpa->plugins[ $slug ]['name']; + } + } + unset( $slug ); + + // Return early if there are no plugins to activate. + if ( empty( $plugins_to_activate ) ) { + echo '

    ', esc_html__( 'No plugins are available to be activated at this time.', 'anaglyph-lite' ), '

    '; + + return false; + } + + // Now we are good to go - let's start activating plugins. + $activate = activate_plugins( $plugins_to_activate ); + + if ( is_wp_error( $activate ) ) { + echo '

    ', wp_kses_post( $activate->get_error_message() ), '

    '; + } else { + $count = count( $plugin_names ); // Count so we can use _n function. + $plugin_names = array_map( array( 'TGMPA_Utils', 'wrap_in_strong' ), $plugin_names ); + $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. + $imploded = empty( $plugin_names ) ? $last_plugin : ( implode( ', ', $plugin_names ) . ' ' . esc_html_x( 'and', 'plugin A *and* plugin B', 'anaglyph-lite' ) . ' ' . $last_plugin ); + + printf( // WPCS: xss ok. + '

    %1$s %2$s.

    ', + esc_html( _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'anaglyph-lite' ) ), + $imploded + ); + + // Update recently activated plugins option. + $recent = (array) get_option( 'recently_activated' ); + foreach ( $plugins_to_activate as $plugin => $time ) { + if ( isset( $recent[ $plugin ] ) ) { + unset( $recent[ $plugin ] ); + } + } + update_option( 'recently_activated', $recent ); + } + + unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. + + return true; + } + + return false; + } + + /** + * Prepares all of our information to be outputted into a usable table. + * + * @since 2.2.0 + */ + public function prepare_items() { + $columns = $this->get_columns(); // Get all necessary column information. + $hidden = array(); // No columns to hide, but we must set as an array. + $sortable = array(); // No reason to make sortable columns. + $primary = $this->get_primary_column_name(); // Column which has the row actions. + $this->_column_headers = array( $columns, $hidden, $sortable, $primary ); // Get all necessary column headers. + + // Process our bulk activations here. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + $this->process_bulk_actions(); + } + + // Store all of our plugin data into $items array so WP_List_Table can use it. + $this->items = apply_filters( 'tgmpa_table_data_items', $this->_gather_plugin_data() ); + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Retrieve plugin data, given the plugin name. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see TGM_Plugin_Activation::_get_plugin_data_from_name()} instead. + * @see TGM_Plugin_Activation::_get_plugin_data_from_name() + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'TGM_Plugin_Activation::_get_plugin_data_from_name()' ); + + return $this->tgmpa->_get_plugin_data_from_name( $name, $data ); + } + } } if ( ! class_exists( 'TGM_Bulk_Installer' ) ) { - /** - * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. - */ - class TGM_Bulk_Installer { - } + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer class from being loaded if 2.4.1- is loaded after 2.5+. + * + * @since 2.5.2 + * + * {@internal The TGMPA_Bulk_Installer class was originally called TGM_Bulk_Installer. + * For more information, see that class.}} + */ + class TGM_Bulk_Installer { + } } if ( ! class_exists( 'TGM_Bulk_Installer_Skin' ) ) { - /** - * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. - */ - class TGM_Bulk_Installer_Skin { - } + /** + * Hack: Prevent TGMPA v2.4.1- bulk installer skin class from being loaded if 2.4.1- is loaded after 2.5+. + * + * @since 2.5.2 + * + * {@internal The TGMPA_Bulk_Installer_Skin class was originally called TGM_Bulk_Installer_Skin. + * For more information, see that class.}} + */ + class TGM_Bulk_Installer_Skin { + } } /** @@ -2923,207 +3053,210 @@ class TGM_Bulk_Installer_Skin { */ add_action( 'admin_init', 'tgmpa_load_bulk_installer' ); if ( ! function_exists( 'tgmpa_load_bulk_installer' ) ) { - /** - * Load bulk installer - */ - function tgmpa_load_bulk_installer() { - // Silently fail if 2.5+ is loaded *after* an older version. - if ( ! isset( $GLOBALS['tgmpa'] ) ) { - return; - } - - // Get TGMPA class instance. - $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { - if ( ! class_exists( 'Plugin_Upgrader', false ) ) { - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - } - - if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { - - /** - * Installer class to handle bulk plugin installations. - * - * Extends WP_Upgrader and customizes to suit the installation of multiple - * plugins. - * - * @since 2.2.0 - * - * @internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader - * @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. - * This was done to prevent backward compatibility issues with v2.3.6. - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_Bulk_Installer extends Plugin_Upgrader { - /** - * Holds result of bulk plugin installation. - * - * @since 2.2.0 - * - * @var string - */ - public $result; - - /** - * Flag to check if bulk installation is occurring or not. - * - * @since 2.2.0 - * - * @var boolean - */ - public $bulk = false; - - /** - * TGMPA instance - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * Whether or not the destination directory needs to be cleared ( = on update). - * - * @since 2.5.0 - * - * @var bool - */ - protected $clear_destination = false; - - /** - * References parent constructor and sets defaults for class. - * - * @since 2.2.0 - * - * @param \Bulk_Upgrader_Skin|null $skin Installer skin. - */ - public function __construct( $skin = null ) { - // Get TGMPA class instance. - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - parent::__construct( $skin ); - - if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { - $this->clear_destination = true; - } - - if ( $this->tgmpa->is_automatic ) { - $this->activate_strings(); - } - - add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); - } - - /** - * Sets the correct activation strings for the installer skin to use. - * - * @since 2.2.0 - */ - public function activate_strings() { - $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'anaglyph-lite' ); - $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'anaglyph-lite' ); - } - - /** - * Performs the actual installation of each plugin. - * - * @since 2.2.0 - * - * @see WP_Upgrader::run() - * - * @param array $options The installation config options. - * @return null|array Return early if error, array of installation data on success. - */ - public function run( $options ) { - $result = parent::run( $options ); - - // Reset the strings in case we changed one during automatic activation. - if ( $this->tgmpa->is_automatic ) { - if ( 'update' === $this->skin->options['install_type'] ) { - $this->upgrade_strings(); - } else { - $this->install_strings(); - } - } - - return $result; - } - - /** - * Processes the bulk installation of plugins. - * - * @since 2.2.0 - * - * @internal This is basically a near identical copy of the WP Core Plugin_Upgrader::bulk_upgrade() - * method, with minor adjustments to deal with new installs instead of upgrades. - * For ease of future synchronizations, the adjustments are clearly commented, but no other - * comments are added. Code style has been made to comply. - * - * @see Plugin_Upgrader::bulk_upgrade() - * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 - * - * @param array $plugins The plugin sources needed for installation. - * @param array $args Arbitrary passed extra arguments. - * @return string|bool Install confirmation messages on success, false on failure. - */ - public function bulk_install( $plugins, $args = array() ) { - // [TGMPA + ] Hook auto-activation in. - add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - $defaults = array( - 'clear_update_cache' => true, - ); - $parsed_args = wp_parse_args( $args, $defaults ); - - $this->init(); - $this->bulk = true; - - $this->install_strings(); // [TGMPA + ] adjusted. - - /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ - - /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ - - $this->skin->header(); - - // Connect to the Filesystem first. - $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); - if ( ! $res ) { - $this->skin->footer(); - - return false; - } - - $this->skin->bulk_header(); - - // Only start maintenance mode if: - // - running Multisite and there are one or more plugins specified, OR - // - a plugin with an update available is currently active. - // @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. - $maintenance = ( is_multisite() && ! empty( $plugins ) ); - - /* + /** + * Load bulk installer + */ + function tgmpa_load_bulk_installer() { + // Silently fail if 2.5+ is loaded *after* an older version. + if ( ! isset( $GLOBALS['tgmpa'] ) ) { + return; + } + + // Get TGMPA class instance. + $tgmpa_instance = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + if ( isset( $_GET['page'] ) && $tgmpa_instance->menu === $_GET['page'] ) { + if ( ! class_exists( 'Plugin_Upgrader', false ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer' ) ) { + + /** + * Installer class to handle bulk plugin installations. + * + * Extends WP_Upgrader and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * {@internal Since 2.5.0 the class is an extension of Plugin_Upgrader rather than WP_Upgrader.}} + * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer to TGMPA_Bulk_Installer. + * This was done to prevent backward compatibility issues with v2.3.6.}} + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer extends Plugin_Upgrader { + /** + * Holds result of bulk plugin installation. + * + * @since 2.2.0 + * + * @var string + */ + public $result; + + /** + * Flag to check if bulk installation is occurring or not. + * + * @since 2.2.0 + * + * @var boolean + */ + public $bulk = false; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Whether or not the destination directory needs to be cleared ( = on update). + * + * @since 2.5.0 + * + * @var bool + */ + protected $clear_destination = false; + + /** + * References parent constructor and sets defaults for class. + * + * @since 2.2.0 + * + * @param \Bulk_Upgrader_Skin|null $skin Installer skin. + */ + public function __construct( $skin = null ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + parent::__construct( $skin ); + + if ( isset( $this->skin->options['install_type'] ) && 'update' === $this->skin->options['install_type'] ) { + $this->clear_destination = true; + } + + if ( $this->tgmpa->is_automatic ) { + $this->activate_strings(); + } + + add_action( 'upgrader_process_complete', array( $this->tgmpa, 'populate_file_path' ) ); + } + + /** + * Sets the correct activation strings for the installer skin to use. + * + * @since 2.2.0 + */ + public function activate_strings() { + $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'anaglyph-lite' ); + $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'anaglyph-lite' ); + } + + /** + * Performs the actual installation of each plugin. + * + * @since 2.2.0 + * + * @see WP_Upgrader::run() + * + * @param array $options The installation config options. + * @return null|array Return early if error, array of installation data on success. + */ + public function run( $options ) { + $result = parent::run( $options ); + + // Reset the strings in case we changed one during automatic activation. + if ( $this->tgmpa->is_automatic ) { + if ( 'update' === $this->skin->options['install_type'] ) { + $this->upgrade_strings(); + } else { + $this->install_strings(); + } + } + + return $result; + } + + /** + * Processes the bulk installation of plugins. + * + * @since 2.2.0 + * + * {@internal This is basically a near identical copy of the WP Core + * Plugin_Upgrader::bulk_upgrade() method, with minor adjustments to deal with + * new installs instead of upgrades. + * For ease of future synchronizations, the adjustments are clearly commented, but no other + * comments are added. Code style has been made to comply.}} + * + * @see Plugin_Upgrader::bulk_upgrade() + * @see https://core.trac.wordpress.org/browser/tags/4.2.1/src/wp-admin/includes/class-wp-upgrader.php#L838 + * (@internal Last synced: Dec 31st 2015 against https://core.trac.wordpress.org/browser/trunk?rev=36134}} + * + * @param array $plugins The plugin sources needed for installation. + * @param array $args Arbitrary passed extra arguments. + * @return array|false Install confirmation messages on success, false on failure. + */ + public function bulk_install( $plugins, $args = array() ) { + // [TGMPA + ] Hook auto-activation in. + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $defaults = array( + 'clear_update_cache' => true, + ); + $parsed_args = wp_parse_args( $args, $defaults ); + + $this->init(); + $this->bulk = true; + + $this->install_strings(); // [TGMPA + ] adjusted. + + /* [TGMPA - ] $current = get_site_transient( 'update_plugins' ); */ + + /* [TGMPA - ] add_filter('upgrader_clear_destination', array($this, 'delete_old_plugin'), 10, 4); */ + + $this->skin->header(); + + // Connect to the Filesystem first. + $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $res ) { + $this->skin->footer(); + return false; + } + + $this->skin->bulk_header(); + + /* + * Only start maintenance mode if: + * - running Multisite and there are one or more plugins specified, OR + * - a plugin with an update available is currently active. + * @TODO: For multisite, maintenance mode should only kick in for individual sites if at all possible. + */ + $maintenance = ( is_multisite() && ! empty( $plugins ) ); + + /* [TGMPA - ] foreach ( $plugins as $plugin ) $maintenance = $maintenance || ( is_plugin_active( $plugin ) && isset( $current->response[ $plugin] ) ); */ - if ( $maintenance ) { - $this->maintenance_mode( true ); - } + if ( $maintenance ) { + $this->maintenance_mode( true ); + } - $results = array(); + $results = array(); - $this->update_count = count( $plugins ); - $this->update_current = 0; - foreach ( $plugins as $plugin ) { - $this->update_current++; + $this->update_count = count( $plugins ); + $this->update_current = 0; + foreach ( $plugins as $plugin ) { + $this->update_current++; - /* + /* [TGMPA - ] $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true); @@ -3136,483 +3269,492 @@ public function bulk_install( $plugins, $args = array() ) { continue; } - // Get the URL to the zip file + // Get the URL to the zip file. $r = $current->response[ $plugin ]; $this->skin->plugin_active = is_plugin_active($plugin); */ - $result = $this->run( array( - 'package' => $plugin, // [TGMPA + ] adjusted. - 'destination' => WP_PLUGIN_DIR, - 'clear_destination' => false, // [TGMPA + ] adjusted. - 'clear_working' => true, - 'is_multi' => true, - 'hook_extra' => array( - 'plugin' => $plugin, - ), - ) ); - - $results[ $plugin ] = $this->result; - - // Prevent credentials auth screen from displaying multiple times. - if ( false === $result ) { - break; - } - } //end foreach $plugins - - $this->maintenance_mode( false ); - - /** - * Fires when the bulk upgrader process is complete. - * - * @since WP 3.6.0 / TGMPA 2.5.0 - * - * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might - * be a Theme_Upgrader or Core_Upgrade instance. - * @param array $data { - * Array of bulk item update data. - * - * @type string $action Type of action. Default 'update'. - * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. - * @type bool $bulk Whether the update process is a bulk update. Default true. - * @type array $packages Array of plugin, theme, or core packages to update. - * } - */ - do_action( 'upgrader_process_complete', $this, array( - 'action' => 'install', // [TGMPA + ] adjusted. - 'type' => 'plugin', - 'bulk' => true, - 'plugins' => $plugins, - ) ); - - $this->skin->bulk_footer(); - - $this->skin->footer(); - - // Cleanup our hooks, in case something else does a upgrade on this connection. - /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ - - // [TGMPA + ] Remove our auto-activation hook. - remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - // Force refresh of plugin update information. - wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); - - return $results; - } - - /** - * Handle a bulk upgrade request. - * - * @since 2.5.0 - * - * @see Plugin_Upgrader::bulk_upgrade() - * - * @param array $plugins The local WP file_path's of the plugins which should be upgraded. - * @param array $args Arbitrary passed extra arguments. - * @return string|bool Install confirmation messages on success, false on failure. - */ - public function bulk_upgrade( $plugins, $args = array() ) { - - add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - $result = parent::bulk_upgrade( $plugins, $args ); - - remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); - - return $result; - } - - /** - * Abuse a filter to auto-activate plugins after installation. - * - * Hooked into the 'upgrader_post_install' filter hook. - * - * @since 2.5.0 - * - * @param bool $bool The value we need to give back (true). - * @return bool - */ - public function auto_activate( $bool ) { - // Only process the activation of installed plugins if the automatic flag is set to true. - if ( $this->tgmpa->is_automatic ) { - // Flush plugins cache so the headers of the newly installed plugins will be read correctly. - wp_clean_plugins_cache(); - - // Get the installed plugin file. - $plugin_info = $this->plugin_info(); - - // Don't try to activate on upgrade of active plugin as WP will do this already. - if ( ! is_plugin_active( $plugin_info ) ) { - $activate = activate_plugin( $plugin_info ); - - // Adjust the success string based on the activation result. - $this->strings['process_success'] = $this->strings['process_success'] . "
    \n"; - - if ( is_wp_error( $activate ) ) { - $this->skin->error( $activate ); - $this->strings['process_success'] .= $this->strings['activation_failed']; - } else { - $this->strings['process_success'] .= $this->strings['activation_success']; - } - } - } - - return $bool; - } - } - } - - if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { - - /** - * Installer skin to set strings for the bulk plugin installations.. - * - * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple - * plugins. - * - * @since 2.2.0 - * - * @internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to - * TGMPA_Bulk_Installer_Skin. - * This was done to prevent backward compatibility issues with v2.3.6. - * - * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php - * - * @package TGM-Plugin-Activation - * @author Thomas Griffin - * @author Gary Jones - */ - class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { - /** - * Holds plugin info for each individual plugin installation. - * - * @since 2.2.0 - * - * @var array - */ - public $plugin_info = array(); - - /** - * Holds names of plugins that are undergoing bulk installations. - * - * @since 2.2.0 - * - * @var array - */ - public $plugin_names = array(); - - /** - * Integer to use for iteration through each plugin installation. - * - * @since 2.2.0 - * - * @var integer - */ - public $i = 0; - - /** - * TGMPA instance - * - * @since 2.5.0 - * - * @var object - */ - protected $tgmpa; - - /** - * Constructor. Parses default args with new ones and extracts them for use. - * - * @since 2.2.0 - * - * @param array $args Arguments to pass for use within the class. - */ - public function __construct( $args = array() ) { - // Get TGMPA class instance. - $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); - - // Parse default and new args. - $defaults = array( - 'url' => '', - 'nonce' => '', - 'names' => array(), - 'install_type' => 'install', - ); - $args = wp_parse_args( $args, $defaults ); - - // Set plugin names to $this->plugin_names property. - $this->plugin_names = $args['names']; - - // Extract the new args. - parent::__construct( $args ); - } - - /** - * Sets install skin strings for each individual plugin. - * - * Checks to see if the automatic activation flag is set and uses the - * the proper strings accordingly. - * - * @since 2.2.0 - */ - public function add_strings() { - if ( 'update' === $this->options['install_type'] ) { - parent::add_strings(); - $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); - } else { - $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'anaglyph-lite' ); - $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'anaglyph-lite' ); - - if ( $this->tgmpa->is_automatic ) { - // Automatic activation strings. - $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'anaglyph-lite' ); - $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Show Details', 'anaglyph-lite' ) . '.'; - $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'anaglyph-lite' ); - $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); - } else { - // Default installation strings. - $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'anaglyph-lite' ); - $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'anaglyph-lite' ) . ' ' . esc_html__( 'Show Details', 'anaglyph-lite' ) . '.'; - $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'anaglyph-lite' ); - $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); - } - } - } - - /** - * Outputs the header strings and necessary JS before each plugin installation. - * - * @since 2.2.0 - * - * @param string $title Unused in this implementation. - */ - public function before( $title = '' ) { - if ( empty( $title ) ) { - $title = esc_html( $this->plugin_names[ $this->i ] ); - } - parent::before( $title ); - } - - /** - * Outputs the footer strings and necessary JS after each plugin installation. - * - * Checks for any errors and outputs them if they exist, else output - * success strings. - * - * @since 2.2.0 - * - * @param string $title Unused in this implementation. - */ - public function after( $title = '' ) { - if ( empty( $title ) ) { - $title = esc_html( $this->plugin_names[ $this->i ] ); - } - parent::after( $title ); - - $this->i++; - } - - /** - * Outputs links after bulk plugin installation is complete. - * - * @since 2.2.0 - */ - public function bulk_footer() { - // Serve up the string to say installations (and possibly activations) are complete. - parent::bulk_footer(); - - // Flush plugins cache so we can make sure that the installed plugins list is always up to date. - wp_clean_plugins_cache(); - - $this->tgmpa->show_tgmpa_version(); - - // Display message based on if all plugins are now active or not. - $update_actions = array(); - - if ( $this->tgmpa->is_tgmpa_complete() ) { - // All plugins are active, so we display the complete string and hide the menu to protect users. - echo ''; - $update_actions['dashboard'] = sprintf( - esc_html( $this->tgmpa->strings['complete'] ), - '' . esc_html__( 'Return to the Dashboard', 'anaglyph-lite' ) . '' - ); - } else { - $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; - } - - /** - * Filter the list of action links available following bulk plugin installs/updates. - * - * @since 2.5.0 - * - * @param array $update_actions Array of plugin action links. - * @param array $plugin_info Array of information for the last-handled plugin. - */ - $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); - - if ( ! empty( $update_actions ) ) { - $this->feedback( implode( ' | ', (array) $update_actions ) ); - } - } - - /* *********** DEPRECATED METHODS *********** */ - - /** - * Flush header output buffer. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead - * @see Bulk_Upgrader_Skin::flush_output() - */ - public function before_flush_output() { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); - $this->flush_output(); - } - - /** - * Flush footer output buffer and iterate $this->i to make sure the - * installation strings reference the correct plugin. - * - * @since 2.2.0 - * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead - * @see Bulk_Upgrader_Skin::flush_output() - */ - public function after_flush_output() { - _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); - $this->flush_output(); - $this->i++; - } - } - } - } - } + $result = $this->run( + array( + 'package' => $plugin, // [TGMPA + ] adjusted. + 'destination' => WP_PLUGIN_DIR, + 'clear_destination' => false, // [TGMPA + ] adjusted. + 'clear_working' => true, + 'is_multi' => true, + 'hook_extra' => array( + 'plugin' => $plugin, + ), + ) + ); + + $results[ $plugin ] = $this->result; + + // Prevent credentials auth screen from displaying multiple times. + if ( false === $result ) { + break; + } + } //end foreach $plugins + + $this->maintenance_mode( false ); + + /** + * Fires when the bulk upgrader process is complete. + * + * @since WP 3.6.0 / TGMPA 2.5.0 + * + * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might + * be a Theme_Upgrader or Core_Upgrade instance. + * @param array $data { + * Array of bulk item update data. + * + * @type string $action Type of action. Default 'update'. + * @type string $type Type of update process. Accepts 'plugin', 'theme', or 'core'. + * @type bool $bulk Whether the update process is a bulk update. Default true. + * @type array $packages Array of plugin, theme, or core packages to update. + * } + */ + do_action( 'upgrader_process_complete', $this, array( + 'action' => 'install', // [TGMPA + ] adjusted. + 'type' => 'plugin', + 'bulk' => true, + 'plugins' => $plugins, + ) ); + + $this->skin->bulk_footer(); + + $this->skin->footer(); + + // Cleanup our hooks, in case something else does a upgrade on this connection. + /* [TGMPA - ] remove_filter('upgrader_clear_destination', array($this, 'delete_old_plugin')); */ + + // [TGMPA + ] Remove our auto-activation hook. + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + // Force refresh of plugin update information. + wp_clean_plugins_cache( $parsed_args['clear_update_cache'] ); + + return $results; + } + + /** + * Handle a bulk upgrade request. + * + * @since 2.5.0 + * + * @see Plugin_Upgrader::bulk_upgrade() + * + * @param array $plugins The local WP file_path's of the plugins which should be upgraded. + * @param array $args Arbitrary passed extra arguments. + * @return string|bool Install confirmation messages on success, false on failure. + */ + public function bulk_upgrade( $plugins, $args = array() ) { + + add_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + $result = parent::bulk_upgrade( $plugins, $args ); + + remove_filter( 'upgrader_post_install', array( $this, 'auto_activate' ), 10 ); + + return $result; + } + + /** + * Abuse a filter to auto-activate plugins after installation. + * + * Hooked into the 'upgrader_post_install' filter hook. + * + * @since 2.5.0 + * + * @param bool $bool The value we need to give back (true). + * @return bool + */ + public function auto_activate( $bool ) { + // Only process the activation of installed plugins if the automatic flag is set to true. + if ( $this->tgmpa->is_automatic ) { + // Flush plugins cache so the headers of the newly installed plugins will be read correctly. + wp_clean_plugins_cache(); + + // Get the installed plugin file. + $plugin_info = $this->plugin_info(); + + // Don't try to activate on upgrade of active plugin as WP will do this already. + if ( ! is_plugin_active( $plugin_info ) ) { + $activate = activate_plugin( $plugin_info ); + + // Adjust the success string based on the activation result. + $this->strings['process_success'] = $this->strings['process_success'] . "
    \n"; + + if ( is_wp_error( $activate ) ) { + $this->skin->error( $activate ); + $this->strings['process_success'] .= $this->strings['activation_failed']; + } else { + $this->strings['process_success'] .= $this->strings['activation_success']; + } + } + } + + return $bool; + } + } + } + + if ( ! class_exists( 'TGMPA_Bulk_Installer_Skin' ) ) { + + /** + * Installer skin to set strings for the bulk plugin installations.. + * + * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * {@internal Since 2.5.2 the class has been renamed from TGM_Bulk_Installer_Skin to + * TGMPA_Bulk_Installer_Skin. + * This was done to prevent backward compatibility issues with v2.3.6.}} + * + * @see https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/class-wp-upgrader-skins.php + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_Bulk_Installer_Skin extends Bulk_Upgrader_Skin { + /** + * Holds plugin info for each individual plugin installation. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_info = array(); + + /** + * Holds names of plugins that are undergoing bulk installations. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_names = array(); + + /** + * Integer to use for iteration through each plugin installation. + * + * @since 2.2.0 + * + * @var integer + */ + public $i = 0; + + /** + * TGMPA instance + * + * @since 2.5.0 + * + * @var object + */ + protected $tgmpa; + + /** + * Constructor. Parses default args with new ones and extracts them for use. + * + * @since 2.2.0 + * + * @param array $args Arguments to pass for use within the class. + */ + public function __construct( $args = array() ) { + // Get TGMPA class instance. + $this->tgmpa = call_user_func( array( get_class( $GLOBALS['tgmpa'] ), 'get_instance' ) ); + + // Parse default and new args. + $defaults = array( + 'url' => '', + 'nonce' => '', + 'names' => array(), + 'install_type' => 'install', + ); + $args = wp_parse_args( $args, $defaults ); + + // Set plugin names to $this->plugin_names property. + $this->plugin_names = $args['names']; + + // Extract the new args. + parent::__construct( $args ); + } + + /** + * Sets install skin strings for each individual plugin. + * + * Checks to see if the automatic activation flag is set and uses the + * the proper strings accordingly. + * + * @since 2.2.0 + */ + public function add_strings() { + if ( 'update' === $this->options['install_type'] ) { + parent::add_strings(); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Updating Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); + } else { + /* translators: 1: plugin name, 2: error message. */ + $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'anaglyph-lite' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'anaglyph-lite' ); + + if ( $this->tgmpa->is_automatic ) { + // Automatic activation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'anaglyph-lite' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'anaglyph-lite' ); + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'anaglyph-lite' ); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); + } else { + // Default installation strings. + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'anaglyph-lite' ); + /* translators: 1: plugin name. */ + $this->upgrader->strings['skin_update_successful'] = esc_html__( '%1$s installed successfully.', 'anaglyph-lite' ); + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'anaglyph-lite' ); + /* translators: 1: plugin name, 2: action number 3: total number of actions. */ + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'anaglyph-lite' ); + } + } + } + + /** + * Outputs the header strings and necessary JS before each plugin installation. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function before( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::before( $title ); + } + + /** + * Outputs the footer strings and necessary JS after each plugin installation. + * + * Checks for any errors and outputs them if they exist, else output + * success strings. + * + * @since 2.2.0 + * + * @param string $title Unused in this implementation. + */ + public function after( $title = '' ) { + if ( empty( $title ) ) { + $title = esc_html( $this->plugin_names[ $this->i ] ); + } + parent::after( $title ); + + $this->i++; + } + + /** + * Outputs links after bulk plugin installation is complete. + * + * @since 2.2.0 + */ + public function bulk_footer() { + // Serve up the string to say installations (and possibly activations) are complete. + parent::bulk_footer(); + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_clean_plugins_cache(); + + $this->tgmpa->show_tgmpa_version(); + + // Display message based on if all plugins are now active or not. + $update_actions = array(); + + if ( $this->tgmpa->is_tgmpa_complete() ) { + // All plugins are active, so we display the complete string and hide the menu to protect users. + echo ''; + $update_actions['dashboard'] = sprintf( + esc_html( $this->tgmpa->strings['complete'] ), + '' . esc_html__( 'Return to the Dashboard', 'anaglyph-lite' ) . '' + ); + } else { + $update_actions['tgmpa_page'] = '' . esc_html( $this->tgmpa->strings['return'] ) . ''; + } + + /** + * Filter the list of action links available following bulk plugin installs/updates. + * + * @since 2.5.0 + * + * @param array $update_actions Array of plugin action links. + * @param array $plugin_info Array of information for the last-handled plugin. + */ + $update_actions = apply_filters( 'tgmpa_update_bulk_plugins_complete_actions', $update_actions, $this->plugin_info ); + + if ( ! empty( $update_actions ) ) { + $this->feedback( implode( ' | ', (array) $update_actions ) ); + } + } + + /* *********** DEPRECATED METHODS *********** */ + + /** + * Flush header output buffer. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function before_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + } + + /** + * Flush footer output buffer and iterate $this->i to make sure the + * installation strings reference the correct plugin. + * + * @since 2.2.0 + * @deprecated 2.5.0 use {@see Bulk_Upgrader_Skin::flush_output()} instead + * @see Bulk_Upgrader_Skin::flush_output() + */ + public function after_flush_output() { + _deprecated_function( __FUNCTION__, 'TGMPA 2.5.0', 'Bulk_Upgrader_Skin::flush_output()' ); + $this->flush_output(); + $this->i++; + } + } + } + } + } } if ( ! class_exists( 'TGMPA_Utils' ) ) { - /** - * Generic utilities for TGMPA. - * - * All methods are static, poor-dev name-spacing class wrapper. - * - * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. - * - * @since 2.5.0 - * - * @package TGM-Plugin-Activation - * @author Juliette Reinders Folmer - */ - class TGMPA_Utils { - /** - * Whether the PHP filter extension is enabled. - * - * @see http://php.net/book.filter - * - * @since 2.5.0 - * - * @static - * - * @var bool $has_filters True is the extension is enabled. - */ - public static $has_filters; - - /** - * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). - * - * @since 2.5.0 - * - * @static - * - * @param string $string Text to be wrapped. - * @return string - */ - public static function wrap_in_em( $string ) { - return '' . wp_kses_post( $string ) . ''; - } - - /** - * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). - * - * @since 2.5.0 - * - * @static - * - * @param string $string Text to be wrapped. - * @return string - */ - public static function wrap_in_strong( $string ) { - return '' . wp_kses_post( $string ) . ''; - } - - /** - * Helper function: Validate a value as boolean - * - * @since 2.5.0 - * - * @static - * - * @param mixed $value Arbitrary value. - * @return bool - */ - public static function validate_bool( $value ) { - if ( ! isset( self::$has_filters ) ) { - self::$has_filters = extension_loaded( 'filter' ); - } - - if ( self::$has_filters ) { - return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); - } else { - return self::emulate_filter_bool( $value ); - } - } - - /** - * Helper function: Cast a value to bool - * - * @since 2.5.0 - * - * @static - * - * @param mixed $value Value to cast. - * @return bool - */ - protected static function emulate_filter_bool( $value ) { - // @codingStandardsIgnoreStart - static $true = array( - '1', - 'true', 'True', 'TRUE', - 'y', 'Y', - 'yes', 'Yes', 'YES', - 'on', 'On', 'ON', - ); - static $false = array( - '0', - 'false', 'False', 'FALSE', - 'n', 'N', - 'no', 'No', 'NO', - 'off', 'Off', 'OFF', - ); - // @codingStandardsIgnoreEnd - - if ( is_bool( $value ) ) { - return $value; - } else if ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { - return (bool) $value; - } else if ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { - return (bool) $value; - } else if ( is_string( $value ) ) { - $value = trim( $value ); - if ( in_array( $value, $true, true ) ) { - return true; - } else if ( in_array( $value, $false, true ) ) { - return false; - } else { - return false; - } - } - - return false; - } - } // End of class TGMPA_Utils + /** + * Generic utilities for TGMPA. + * + * All methods are static, poor-dev name-spacing class wrapper. + * + * Class was called TGM_Utils in 2.5.0 but renamed TGMPA_Utils in 2.5.1 as this was conflicting with Soliloquy. + * + * @since 2.5.0 + * + * @package TGM-Plugin-Activation + * @author Juliette Reinders Folmer + */ + class TGMPA_Utils { + /** + * Whether the PHP filter extension is enabled. + * + * @see http://php.net/book.filter + * + * @since 2.5.0 + * + * @static + * + * @var bool $has_filters True is the extension is enabled. + */ + public static $has_filters; + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_em( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Wrap an arbitrary string in tags. Meant to be used in combination with array_map(). + * + * @since 2.5.0 + * + * @static + * + * @param string $string Text to be wrapped. + * @return string + */ + public static function wrap_in_strong( $string ) { + return '' . wp_kses_post( $string ) . ''; + } + + /** + * Helper function: Validate a value as boolean + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Arbitrary value. + * @return bool + */ + public static function validate_bool( $value ) { + if ( ! isset( self::$has_filters ) ) { + self::$has_filters = extension_loaded( 'filter' ); + } + + if ( self::$has_filters ) { + return filter_var( $value, FILTER_VALIDATE_BOOLEAN ); + } else { + return self::emulate_filter_bool( $value ); + } + } + + /** + * Helper function: Cast a value to bool + * + * @since 2.5.0 + * + * @static + * + * @param mixed $value Value to cast. + * @return bool + */ + protected static function emulate_filter_bool( $value ) { + // @codingStandardsIgnoreStart + static $true = array( + '1', + 'true', 'True', 'TRUE', + 'y', 'Y', + 'yes', 'Yes', 'YES', + 'on', 'On', 'ON', + ); + static $false = array( + '0', + 'false', 'False', 'FALSE', + 'n', 'N', + 'no', 'No', 'NO', + 'off', 'Off', 'OFF', + ); + // @codingStandardsIgnoreEnd + + if ( is_bool( $value ) ) { + return $value; + } elseif ( is_int( $value ) && ( 0 === $value || 1 === $value ) ) { + return (bool) $value; + } elseif ( ( is_float( $value ) && ! is_nan( $value ) ) && ( (float) 0 === $value || (float) 1 === $value ) ) { + return (bool) $value; + } elseif ( is_string( $value ) ) { + $value = trim( $value ); + if ( in_array( $value, $true, true ) ) { + return true; + } elseif ( in_array( $value, $false, true ) ) { + return false; + } else { + return false; + } + } + + return false; + } + } // End of class TGMPA_Utils } // End of class_exists wrapper diff --git a/includes/theme/assets/css/woo.css b/includes/theme/assets/css/woo.css index 32f8685..e6a59dd 100644 --- a/includes/theme/assets/css/woo.css +++ b/includes/theme/assets/css/woo.css @@ -401,6 +401,10 @@ padding-bottom: 20px; position: relative; } +.product.has-default-attributes.has-children.anaglyph-woo-has-gallery > .images { + opacity: 1; +} + .anaglyph-woo-has-gallery .onsale { z-index: 9; } diff --git a/includes/theme/assets/js/jquery.scrollTo.min.js b/includes/theme/assets/js/jquery.scrollTo.min.js index f809901..ead8108 100644 --- a/includes/theme/assets/js/jquery.scrollTo.min.js +++ b/includes/theme/assets/js/jquery.scrollTo.min.js @@ -2,6 +2,6 @@ * Copyright (c) 2007-2015 Ariel Flesler - afleslergmailcom | http://flesler.blogspot.com * Licensed under MIT * @author Ariel Flesler - * @version 2.1.1 + * @version 2.1.2 */ -;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1=f[g]?0:Math.min(f[g],n));!a&&1 __( 'Top primary menu', 'anaglyph-lite' ) ) ); @@ -831,7 +835,7 @@ function anaglyph_get_footer_contact_form() { global $anaglyph_config; $out_ = ''; $class_title = $title = $sub_title = $name_company = $location = $skype = $scroll_reveal = ''; - $tel = $fax = ''; + $tel = $fax = $add_email = ''; if ($anaglyph_config['contact-animations']) { $scroll_reveal = 'data-scroll-reveal="enter left and move 50px"'; @@ -847,7 +851,7 @@ function anaglyph_get_footer_contact_form() { if (!empty($anaglyph_config['contact-fax'])) { $fax = esc_attr($anaglyph_config['contact-fax']); } if (!empty($anaglyph_config['contact-email'])) { $email = esc_attr($anaglyph_config['contact-email']); } if (!empty($anaglyph_config['contact-skype'])) { $skype = esc_attr($anaglyph_config['contact-skype']); } - + if (!empty($anaglyph_config['contact-add-email'])) { $add_email = esc_attr($anaglyph_config['contact-add-email']); } $out_ .= '
    ', - esc_html__( 'Upgrade message from the plugin author:', 'anaglyph-lite' ), - ' ', wp_kses_data( $item['upgrade_notice'] ), ' + esc_html__( 'Upgrade message from the plugin author:', 'anaglyph-lite' ), + ' ', wp_kses_data( $item['upgrade_notice'] ), '