Premium Addons for Elementor - Version 4.9.9

Version Description

  • Tweak: Added WPML compatibility for Nav/Mega Menu widget.
Download this release

Release Info

Developer leap13
Plugin Icon 128x128 Premium Addons for Elementor
Version 4.9.9
Comparing to
See all releases

Code changes from version 4.9.8 to 4.9.9

admin/assets/css/admin-rtl.css CHANGED
@@ -1871,10 +1871,6 @@ input:checked+.slider:before {
1871
  content: "\e924";
1872
  }
1873
 
1874
- .pa-dash-premium-trustpilot-reviews:before {
1875
- content: "\e920";
1876
- }
1877
-
1878
  .pa-dash-premium-banner:before {
1879
  content: "\e925";
1880
  }
1871
  content: "\e924";
1872
  }
1873
 
 
 
 
 
1874
  .pa-dash-premium-banner:before {
1875
  content: "\e925";
1876
  }
admin/assets/css/admin.css CHANGED
@@ -1934,10 +1934,6 @@ input:checked+.slider:before {
1934
  content: "\e924";
1935
  }
1936
 
1937
- .pa-dash-premium-trustpilot-reviews:before {
1938
- content: "\e920";
1939
- }
1940
-
1941
  .pa-dash-premium-banner:before {
1942
  content: "\e925";
1943
  }
1934
  content: "\e924";
1935
  }
1936
 
 
 
 
 
1937
  .pa-dash-premium-banner:before {
1938
  content: "\e925";
1939
  }
admin/assets/fonts/pa-dashboard.svg CHANGED
@@ -39,7 +39,6 @@
39
  <glyph unicode="&#xe91d;" glyph-name="preview-window" d="M718.336-64h-564.736c-84.831 0-153.6 68.769-153.6 153.6v0 564.736c0 84.831 68.769 153.6 153.6 153.6v0h355.84c28.277 0 51.2-22.923 51.2-51.2s-22.923-51.2-51.2-51.2v0h-355.84c-28.277 0-51.2-22.923-51.2-51.2v0-564.736c0-28.277 22.923-51.2 51.2-51.2v0h564.736c28.277 0 51.2 22.923 51.2 51.2v0 354.304c0 28.277 22.923 51.2 51.2 51.2s51.2-22.923 51.2-51.2v0-354.304c0-84.831-68.769-153.6-153.6-153.6v0zM820.736 553.472c-0.229-0.001-0.499-0.001-0.769-0.001-111.566 0-202.059 90.224-202.494 201.688v3.882c0 112.26 91.004 203.264 203.264 203.264s203.264-91.004 203.264-203.264v0-3.84c-0.436-111.505-90.929-201.729-202.495-201.729-0.271 0-0.541 0.001-0.811 0.002h0.042zM820.736 857.6c-0.307 0.003-0.669 0.005-1.032 0.005-54.692 0-99.113-43.976-99.831-98.498l-0.001-0.068v-3.84c0-55.706 45.158-100.864 100.864-100.864s100.864 45.158 100.864 100.864v0 3.84c-0.719 54.589-45.14 98.565-99.832 98.565-0.363 0-0.725-0.002-1.087-0.006h0.055z" />
40
  <glyph unicode="&#xe91e;" glyph-name="tables" d="M966.144 960h-908.288c-31.953 0-57.856-25.903-57.856-57.856v0-908.288c0-31.953 25.903-57.856 57.856-57.856v0h908.288c31.953 0 57.856 25.903 57.856 57.856v0 908.288c0 31.953-25.903 57.856-57.856 57.856v0zM418.56 844.288h186.88v-187.136h-186.88zM418.56 541.44h186.88v-186.88h-186.88zM302.848 51.712h-187.136v187.136h187.136zM302.848 354.56h-187.136v186.88h187.136zM302.848 657.152h-187.136v187.136h187.136zM605.44 51.712h-186.88v187.136h186.88zM908.288 51.712h-187.136v187.136h187.136zM908.288 354.56h-187.136v186.88h187.136zM908.288 657.152h-187.136v187.136h187.136z" />
41
  <glyph unicode="&#xe91f;" glyph-name="tabs" d="M972.8 532.48h-921.6c-28.277 0-51.2 22.923-51.2 51.2v0 325.12c0 28.277 22.923 51.2 51.2 51.2v0h921.6c28.277 0 51.2-22.923 51.2-51.2v0-325.12c0-28.277-22.923-51.2-51.2-51.2v0zM102.4 634.88h819.2v222.72h-819.2zM972.8-64h-921.6c-28.277 0-51.2 22.923-51.2 51.2v0 325.12c0 28.277 22.923 51.2 51.2 51.2v0h921.6c28.277 0 51.2-22.923 51.2-51.2v0-325.12c0-28.277-22.923-51.2-51.2-51.2v0zM102.4 38.4h819.2v222.72h-819.2z" />
42
- <glyph unicode="&#xe920;" glyph-name="trustpilot" d="M195.584-39.424l119.808 374.528-315.392 227.328 389.888 2.816 122.112 369.152 119.296-369.152 392.704-2.816-512-369.152-316.416-232.704zM832-36.864l-320 230.144 221.696 61.44 98.304-291.584z" />
43
  <glyph unicode="&#xe921;" glyph-name="twitter-feed" d="M322.048 38.4c386.304 0 597.76 320 597.76 597.76 0 8.96 0 17.92 0 27.136 41.023 30.13 75.596 66.169 103.222 107.268l0.97 1.532c-35.109-16.142-75.839-27.862-118.577-33.081l-1.999-0.199c43.321 26.458 75.94 66.791 91.98 114.721l0.436 1.503c-38.467-23.22-83.226-40.975-130.898-50.732l-2.734-0.468c-38.48 41.26-93.16 66.981-153.847 66.981-116.077 0-210.176-94.099-210.176-210.176 0-17.133 2.050-33.786 5.918-49.729l-0.295 1.437c-174.874 9.249-328.64 92.418-431.795 218.582l-0.845 1.066c-18.199-30.472-28.959-67.211-28.959-106.463 0-72.791 37.004-136.939 93.226-174.659l0.757-0.478c-34.967 0.923-67.551 10.298-96.041 26.144l1.065-0.544v-2.56c0.591-100.815 72.070-184.766 167.084-204.562l1.364-0.238c-15.949-4.402-34.263-6.932-53.168-6.932-1.018 0-2.034 0.007-3.049 0.022l0.153-0.002c-14.1 0.109-27.804 1.501-41.090 4.067l1.41-0.227c27.752-84.096 104.81-144.061 196.135-145.917l0.217-0.003c-70.634-55.776-160.879-89.566-259.006-89.856h-0.066c-0.057 0-0.125 0-0.193 0-17.97 0-35.702 1.023-53.139 3.014l2.132-0.198c90.704-59.076 201.703-94.209 320.908-94.209 0.401 0 0.801 0 1.202 0.001h-0.062z" />
44
  <glyph unicode="&#xe922;" glyph-name="unfold" d="M1024 448c0-28.277-22.923-51.2-51.2-51.2v0h-409.6v-409.6c0-28.277-22.923-51.2-51.2-51.2s-51.2 22.923-51.2 51.2v0 409.6h-409.6c-28.277 0-51.2 22.923-51.2 51.2s22.923 51.2 51.2 51.2v0h409.6v409.6c0 28.277 22.923 51.2 51.2 51.2s51.2-22.923 51.2-51.2v0-409.6h409.6c28.277 0 51.2-22.923 51.2-51.2v0z" />
45
  <glyph unicode="&#xe923;" glyph-name="whatsapp-chat" horiz-adv-x="1019" d="M870.4 811.264c-91.866 92.1-218.903 149.081-359.249 149.081-280.225 0-507.392-227.167-507.392-507.392 0-93.548 25.317-181.184 69.472-256.429l-1.295 2.388-71.936-262.912 268.8 70.656c70.087-38.943 153.7-61.891 242.669-61.952h0.019c280.104 0.348 507.038 227.496 507.038 507.648 0 140.159-56.801 267.051-148.639 358.914l0.001-0.001zM512 30.464v0c-0.009 0-0.019 0-0.029 0-79.439 0-153.744 21.982-217.163 60.196l1.896-1.060-15.36 8.96-159.744-41.984 42.752 155.648-9.984 15.872c-40.423 63.543-64.423 140.968-64.423 223.998 0 232.861 188.771 421.632 421.632 421.632s421.632-188.771 421.632-421.632c0-232.442-188.093-420.953-420.376-421.63h-0.065zM742.144 347.392c12.544-6.4 21.248-9.472 24.32-14.848l-0.089 0.633c1.001-5.888 1.523-11.939 1.523-18.111 0-15.434-3.26-30.107-8.858-42.682-10.496-29.696-61.184-56.832-85.504-60.416l1.039 0.153c-9.827-1.745-19.943-2.655-30.271-2.655-18.072 0-35.494 2.787-50.639 7.622l-5.361 1.405c-24.577 7.491-48.624 16.199-67.087 24.195-126.976 55.040-210.176 183.040-216.576 191.488l0.409-0.543c-28.693 36.665-47.273 81.626-51.609 131.615l0.001-0.1c-0.009 0.663-0.014 1.327-0.014 1.992 0 40.677 17.094 77.361 44.557 103.324l0.043 0.050c8.344 9.44 20.436 15.491 34.005 15.822h24.32c7.68-0.512 17.92 3.84 28.416-21.76s35.84-87.808 39.168-94.208l-0.063 0.13c1.784-3.361 2.795-7.196 2.795-11.266s-1.011-7.905-2.732-11.136l-0.859-1.458c-9.382-14.874-19.843-28.999-30.885-41.806-5.632-6.912-13.056-13.056-5.632-25.6l0.97-1.764c18.932-31.885 42.368-60.781 69.686-86.044l-0.339 0.297c29.389-26.221 63.303-47.477 102.739-63.273 12.8-6.4 19.968-5.376 27.392 3.072s31.744 36.864 40.192 49.664c8.448 12.8 17.152 10.496 28.672 6.4s73.728-34.816 86.528-41.216z" />
39
  <glyph unicode="&#xe91d;" glyph-name="preview-window" d="M718.336-64h-564.736c-84.831 0-153.6 68.769-153.6 153.6v0 564.736c0 84.831 68.769 153.6 153.6 153.6v0h355.84c28.277 0 51.2-22.923 51.2-51.2s-22.923-51.2-51.2-51.2v0h-355.84c-28.277 0-51.2-22.923-51.2-51.2v0-564.736c0-28.277 22.923-51.2 51.2-51.2v0h564.736c28.277 0 51.2 22.923 51.2 51.2v0 354.304c0 28.277 22.923 51.2 51.2 51.2s51.2-22.923 51.2-51.2v0-354.304c0-84.831-68.769-153.6-153.6-153.6v0zM820.736 553.472c-0.229-0.001-0.499-0.001-0.769-0.001-111.566 0-202.059 90.224-202.494 201.688v3.882c0 112.26 91.004 203.264 203.264 203.264s203.264-91.004 203.264-203.264v0-3.84c-0.436-111.505-90.929-201.729-202.495-201.729-0.271 0-0.541 0.001-0.811 0.002h0.042zM820.736 857.6c-0.307 0.003-0.669 0.005-1.032 0.005-54.692 0-99.113-43.976-99.831-98.498l-0.001-0.068v-3.84c0-55.706 45.158-100.864 100.864-100.864s100.864 45.158 100.864 100.864v0 3.84c-0.719 54.589-45.14 98.565-99.832 98.565-0.363 0-0.725-0.002-1.087-0.006h0.055z" />
40
  <glyph unicode="&#xe91e;" glyph-name="tables" d="M966.144 960h-908.288c-31.953 0-57.856-25.903-57.856-57.856v0-908.288c0-31.953 25.903-57.856 57.856-57.856v0h908.288c31.953 0 57.856 25.903 57.856 57.856v0 908.288c0 31.953-25.903 57.856-57.856 57.856v0zM418.56 844.288h186.88v-187.136h-186.88zM418.56 541.44h186.88v-186.88h-186.88zM302.848 51.712h-187.136v187.136h187.136zM302.848 354.56h-187.136v186.88h187.136zM302.848 657.152h-187.136v187.136h187.136zM605.44 51.712h-186.88v187.136h186.88zM908.288 51.712h-187.136v187.136h187.136zM908.288 354.56h-187.136v186.88h187.136zM908.288 657.152h-187.136v187.136h187.136z" />
41
  <glyph unicode="&#xe91f;" glyph-name="tabs" d="M972.8 532.48h-921.6c-28.277 0-51.2 22.923-51.2 51.2v0 325.12c0 28.277 22.923 51.2 51.2 51.2v0h921.6c28.277 0 51.2-22.923 51.2-51.2v0-325.12c0-28.277-22.923-51.2-51.2-51.2v0zM102.4 634.88h819.2v222.72h-819.2zM972.8-64h-921.6c-28.277 0-51.2 22.923-51.2 51.2v0 325.12c0 28.277 22.923 51.2 51.2 51.2v0h921.6c28.277 0 51.2-22.923 51.2-51.2v0-325.12c0-28.277-22.923-51.2-51.2-51.2v0zM102.4 38.4h819.2v222.72h-819.2z" />
 
42
  <glyph unicode="&#xe921;" glyph-name="twitter-feed" d="M322.048 38.4c386.304 0 597.76 320 597.76 597.76 0 8.96 0 17.92 0 27.136 41.023 30.13 75.596 66.169 103.222 107.268l0.97 1.532c-35.109-16.142-75.839-27.862-118.577-33.081l-1.999-0.199c43.321 26.458 75.94 66.791 91.98 114.721l0.436 1.503c-38.467-23.22-83.226-40.975-130.898-50.732l-2.734-0.468c-38.48 41.26-93.16 66.981-153.847 66.981-116.077 0-210.176-94.099-210.176-210.176 0-17.133 2.050-33.786 5.918-49.729l-0.295 1.437c-174.874 9.249-328.64 92.418-431.795 218.582l-0.845 1.066c-18.199-30.472-28.959-67.211-28.959-106.463 0-72.791 37.004-136.939 93.226-174.659l0.757-0.478c-34.967 0.923-67.551 10.298-96.041 26.144l1.065-0.544v-2.56c0.591-100.815 72.070-184.766 167.084-204.562l1.364-0.238c-15.949-4.402-34.263-6.932-53.168-6.932-1.018 0-2.034 0.007-3.049 0.022l0.153-0.002c-14.1 0.109-27.804 1.501-41.090 4.067l1.41-0.227c27.752-84.096 104.81-144.061 196.135-145.917l0.217-0.003c-70.634-55.776-160.879-89.566-259.006-89.856h-0.066c-0.057 0-0.125 0-0.193 0-17.97 0-35.702 1.023-53.139 3.014l2.132-0.198c90.704-59.076 201.703-94.209 320.908-94.209 0.401 0 0.801 0 1.202 0.001h-0.062z" />
43
  <glyph unicode="&#xe922;" glyph-name="unfold" d="M1024 448c0-28.277-22.923-51.2-51.2-51.2v0h-409.6v-409.6c0-28.277-22.923-51.2-51.2-51.2s-51.2 22.923-51.2 51.2v0 409.6h-409.6c-28.277 0-51.2 22.923-51.2 51.2s22.923 51.2 51.2 51.2v0h409.6v409.6c0 28.277 22.923 51.2 51.2 51.2s51.2-22.923 51.2-51.2v0-409.6h409.6c28.277 0 51.2-22.923 51.2-51.2v0z" />
44
  <glyph unicode="&#xe923;" glyph-name="whatsapp-chat" horiz-adv-x="1019" d="M870.4 811.264c-91.866 92.1-218.903 149.081-359.249 149.081-280.225 0-507.392-227.167-507.392-507.392 0-93.548 25.317-181.184 69.472-256.429l-1.295 2.388-71.936-262.912 268.8 70.656c70.087-38.943 153.7-61.891 242.669-61.952h0.019c280.104 0.348 507.038 227.496 507.038 507.648 0 140.159-56.801 267.051-148.639 358.914l0.001-0.001zM512 30.464v0c-0.009 0-0.019 0-0.029 0-79.439 0-153.744 21.982-217.163 60.196l1.896-1.060-15.36 8.96-159.744-41.984 42.752 155.648-9.984 15.872c-40.423 63.543-64.423 140.968-64.423 223.998 0 232.861 188.771 421.632 421.632 421.632s421.632-188.771 421.632-421.632c0-232.442-188.093-420.953-420.376-421.63h-0.065zM742.144 347.392c12.544-6.4 21.248-9.472 24.32-14.848l-0.089 0.633c1.001-5.888 1.523-11.939 1.523-18.111 0-15.434-3.26-30.107-8.858-42.682-10.496-29.696-61.184-56.832-85.504-60.416l1.039 0.153c-9.827-1.745-19.943-2.655-30.271-2.655-18.072 0-35.494 2.787-50.639 7.622l-5.361 1.405c-24.577 7.491-48.624 16.199-67.087 24.195-126.976 55.040-210.176 183.040-216.576 191.488l0.409-0.543c-28.693 36.665-47.273 81.626-51.609 131.615l0.001-0.1c-0.009 0.663-0.014 1.327-0.014 1.992 0 40.677 17.094 77.361 44.557 103.324l0.043 0.050c8.344 9.44 20.436 15.491 34.005 15.822h24.32c7.68-0.512 17.92 3.84 28.416-21.76s35.84-87.808 39.168-94.208l-0.063 0.13c1.784-3.361 2.795-7.196 2.795-11.266s-1.011-7.905-2.732-11.136l-0.859-1.458c-9.382-14.874-19.843-28.999-30.885-41.806-5.632-6.912-13.056-13.056-5.632-25.6l0.97-1.764c18.932-31.885 42.368-60.781 69.686-86.044l-0.339 0.297c29.389-26.221 63.303-47.477 102.739-63.273 12.8-6.4 19.968-5.376 27.392 3.072s31.744 36.864 40.192 49.664c8.448 12.8 17.152 10.496 28.672 6.4s73.728-34.816 86.528-41.216z" />
admin/includes/elements.php CHANGED
@@ -348,17 +348,6 @@ $elements = array(
348
  'icon' => 'pa-pro-yelp-reviews',
349
  'action_url' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-yelp-reviews-widget/', 'editor-page', 'wp-editor', 'get-pro' ),
350
  ),
351
- array(
352
- 'key' => 'premium-trustpilot-reviews',
353
- 'name' => 'premium-trustpilot-reviews',
354
- 'title' => __( 'Trustpilot Reviews', 'premium-addons-for-elementor' ),
355
- 'demo' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-trustpilot-reviews-widget/', 'settings-page', 'wp-dash', 'dashboard' ),
356
- 'doc' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/elementor-trustpilot-reviews-widget-tutorial/', 'settings-page', 'wp-dash', 'dashboard' ),
357
- 'is_pro' => true,
358
- 'is_new' => true,
359
- 'icon' => 'pa-pro-trust-reviews',
360
- 'action_url' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-trustpilot-reviews-widget/', 'editor-page', 'wp-editor', 'get-pro' ),
361
- ),
362
  array(
363
  'key' => 'premium-countdown',
364
  'name' => 'premium-countdown-timer',
@@ -880,15 +869,6 @@ $elements = array(
880
  'tutorial' => 'https://www.youtube.com/watch?v=5T-MveVFvns',
881
  'is_pro' => true,
882
  ),
883
- array(
884
- 'key' => 'premium-trustpilot-reviews',
885
- 'name' => 'premium-trustpilot-reviews',
886
- 'title' => __( 'Trustpilot Reviews', 'premium-addons-for-elementor' ),
887
- 'demo' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-trustpilot-reviews-widget/', 'settings-page', 'wp-dash', 'dashboard' ),
888
- 'doc' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/elementor-trustpilot-reviews-widget-tutorial/', 'settings-page', 'wp-dash', 'dashboard' ),
889
- 'is_pro' => true,
890
- 'is_new' => true,
891
- ),
892
  ),
893
  ),
894
  'cat-7' => array(
348
  'icon' => 'pa-pro-yelp-reviews',
349
  'action_url' => Helper_Functions::get_campaign_link( 'https://premiumaddons.com/elementor-yelp-reviews-widget/', 'editor-page', 'wp-editor', 'get-pro' ),
350
  ),
 
 
 
 
 
 
 
 
 
 
 
351
  array(
352
  'key' => 'premium-countdown',
353
  'name' => 'premium-countdown-timer',
869
  'tutorial' => 'https://www.youtube.com/watch?v=5T-MveVFvns',
870
  'is_pro' => true,
871
  ),
 
 
 
 
 
 
 
 
 
872
  ),
873
  ),
874
  'cat-7' => array(
assets/editor/fonts/pa-elements.svg CHANGED
@@ -7,7 +7,6 @@
7
  <font-face units-per-em="1024" ascent="960" descent="-64" />
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
10
- <glyph unicode="&#xe900;" glyph-name="trustpilot" horiz-adv-x="1077" d="M205.661-64l125.981 393.825-331.642 239.041 409.977 2.961 128.404 388.172 125.443-388.172 412.938-2.961-538.381-388.172-332.719-244.694zM874.869-61.308l-336.488 242.002 233.119 64.606 103.369-306.608z" />
11
  <glyph unicode="&#xe901;" glyph-name="pa-behance-feed" d="M407.738 459.171l-9.309 5.585 9.309 7.447c35.375 27.927 55.855 68.887 55.855 113.571 0 80.058-65.164 145.222-145.222 145.222h-232.727c-13.033 0-22.342-9.309-22.342-22.342v-519.447c0-13.033 9.309-22.342 22.342-22.342h234.589c89.367 0 160.116 72.611 160.116 160.116-1.862 52.131-27.927 102.4-72.611 132.189zM318.371 209.687h-210.385v232.727h210.385c63.302 0 115.433-52.131 115.433-115.433 0-65.164-50.269-117.295-115.433-117.295zM107.985 686.313h210.385c55.855 0 98.676-44.684 98.676-98.676s-44.684-98.676-98.676-98.676h-210.385v197.353zM746.589 593.222c-117.295 0-214.109-96.815-214.109-214.109s96.815-214.109 214.109-214.109c57.716 0 111.709 22.342 150.807 63.302 5.585 5.585 5.585 13.033 5.585 16.756s0 9.309-7.447 16.756c-5.585 5.585-13.033 7.447-16.756 7.447-5.585 0-11.171-1.862-16.756-7.447-31.651-31.651-74.473-50.269-119.156-50.269-81.92 0-150.807 57.716-165.702 137.775l-1.862 9.309h359.331c13.033 0 22.342 9.309 22.342 22.342 3.724 117.295-91.229 212.247-210.385 212.247zM914.153 401.455h-335.127l1.862 9.309c14.895 80.058 85.644 137.775 165.702 137.775s150.807-57.716 165.702-137.775l1.862-9.309zM889.949 691.898c0-13.033-9.309-22.342-22.342-22.342h-256.931c-13.033 0-22.342 9.309-22.342 22.342s9.309 22.342 22.342 22.342h256.931c11.171 0 22.342-9.309 22.342-22.342z" />
12
  <glyph unicode="&#xe902;" glyph-name="pa-charts" d="M584.611 896.698c-9.309 0-18.618-7.447-18.618-18.618v-359.331c0-9.309 7.447-18.618 18.618-18.618h359.331c9.309 0 18.618 7.447 18.618 18.618 0 93.091-33.513 180.596-94.953 249.484-70.749 81.92-173.149 128.465-282.996 128.465v0zM603.229 537.367v322.095c91.229-5.585 176.873-46.545 238.313-115.433 50.269-57.716 80.058-130.327 85.644-208.524h-323.956zM875.055 407.040c0 9.309-7.447 18.618-18.618 18.618h-370.502v368.64c0 9.309-7.447 18.618-18.618 18.618-225.28 0-407.738-182.458-407.738-407.738 0-223.418 182.458-407.738 407.738-407.738 225.28 1.862 407.738 184.32 407.738 409.6v0zM467.316 36.538c-204.8 0-370.502 165.702-370.502 370.502 0 197.353 156.393 361.193 351.884 370.502v-370.502c0-9.309 7.447-18.618 18.618-18.618h370.502c-9.309-195.491-171.287-351.884-370.502-351.884v0z" />
13
  <glyph unicode="&#xe903;" glyph-name="pa-color-transition" d="M943.942 401.455h-191.767l135.913 135.913c7.447 7.447 7.447 18.618 0 26.065l-258.793 258.793c-3.724 3.724-7.447 5.585-13.033 5.585s-9.309-1.862-13.033-5.585l-135.913-135.913v199.215c0 9.309-7.447 18.618-18.618 18.618h-366.778c-9.309 0-18.618-7.447-18.618-18.618v-698.182c0-104.262 85.644-189.905 189.905-189.905h690.735c9.309 0 18.618 7.447 18.618 18.618v366.778c0 9.309-7.447 18.618-18.618 18.618zM467.316 628.596l230.865-230.865-126.604-126.604-104.262 104.262v253.207zM467.316 187.345v137.775l78.196-78.196-80.058-80.058c0 5.585 1.862 13.033 1.862 20.48zM100.538 868.771h331.404v-165.702h-331.404v165.702zM100.538 665.833h331.404v-178.735h-331.404v178.735zM100.538 449.862h331.404v-178.735h-331.404v178.735zM277.411 34.676h-22.342c-42.822 0-80.058 16.756-107.985 44.684s-44.684 67.025-44.684 107.985v48.407h331.404v-48.407c-3.724-83.782-72.611-152.669-156.393-152.669zM497.105 34.676h-107.985c18.618 14.895 35.375 31.651 48.407 52.131l59.578 59.578v-111.709zM711.215 34.676h-178.735v148.945l178.735 178.735v-327.68zM489.658 656.524l126.604 126.604 232.727-232.727-126.604-126.604-232.727 232.727zM925.324 34.676h-178.735v329.542h178.735v-329.542zM310.924 159.418c0-24.204-20.48-44.684-46.545-44.684-24.204 0-46.545 20.48-46.545 44.684 0 26.065 20.48 46.545 46.545 46.545s46.545-20.48 46.545-46.545z" />
7
  <font-face units-per-em="1024" ascent="960" descent="-64" />
8
  <missing-glyph horiz-adv-x="1024" />
9
  <glyph unicode="&#x20;" horiz-adv-x="512" d="" />
 
10
  <glyph unicode="&#xe901;" glyph-name="pa-behance-feed" d="M407.738 459.171l-9.309 5.585 9.309 7.447c35.375 27.927 55.855 68.887 55.855 113.571 0 80.058-65.164 145.222-145.222 145.222h-232.727c-13.033 0-22.342-9.309-22.342-22.342v-519.447c0-13.033 9.309-22.342 22.342-22.342h234.589c89.367 0 160.116 72.611 160.116 160.116-1.862 52.131-27.927 102.4-72.611 132.189zM318.371 209.687h-210.385v232.727h210.385c63.302 0 115.433-52.131 115.433-115.433 0-65.164-50.269-117.295-115.433-117.295zM107.985 686.313h210.385c55.855 0 98.676-44.684 98.676-98.676s-44.684-98.676-98.676-98.676h-210.385v197.353zM746.589 593.222c-117.295 0-214.109-96.815-214.109-214.109s96.815-214.109 214.109-214.109c57.716 0 111.709 22.342 150.807 63.302 5.585 5.585 5.585 13.033 5.585 16.756s0 9.309-7.447 16.756c-5.585 5.585-13.033 7.447-16.756 7.447-5.585 0-11.171-1.862-16.756-7.447-31.651-31.651-74.473-50.269-119.156-50.269-81.92 0-150.807 57.716-165.702 137.775l-1.862 9.309h359.331c13.033 0 22.342 9.309 22.342 22.342 3.724 117.295-91.229 212.247-210.385 212.247zM914.153 401.455h-335.127l1.862 9.309c14.895 80.058 85.644 137.775 165.702 137.775s150.807-57.716 165.702-137.775l1.862-9.309zM889.949 691.898c0-13.033-9.309-22.342-22.342-22.342h-256.931c-13.033 0-22.342 9.309-22.342 22.342s9.309 22.342 22.342 22.342h256.931c11.171 0 22.342-9.309 22.342-22.342z" />
11
  <glyph unicode="&#xe902;" glyph-name="pa-charts" d="M584.611 896.698c-9.309 0-18.618-7.447-18.618-18.618v-359.331c0-9.309 7.447-18.618 18.618-18.618h359.331c9.309 0 18.618 7.447 18.618 18.618 0 93.091-33.513 180.596-94.953 249.484-70.749 81.92-173.149 128.465-282.996 128.465v0zM603.229 537.367v322.095c91.229-5.585 176.873-46.545 238.313-115.433 50.269-57.716 80.058-130.327 85.644-208.524h-323.956zM875.055 407.040c0 9.309-7.447 18.618-18.618 18.618h-370.502v368.64c0 9.309-7.447 18.618-18.618 18.618-225.28 0-407.738-182.458-407.738-407.738 0-223.418 182.458-407.738 407.738-407.738 225.28 1.862 407.738 184.32 407.738 409.6v0zM467.316 36.538c-204.8 0-370.502 165.702-370.502 370.502 0 197.353 156.393 361.193 351.884 370.502v-370.502c0-9.309 7.447-18.618 18.618-18.618h370.502c-9.309-195.491-171.287-351.884-370.502-351.884v0z" />
12
  <glyph unicode="&#xe903;" glyph-name="pa-color-transition" d="M943.942 401.455h-191.767l135.913 135.913c7.447 7.447 7.447 18.618 0 26.065l-258.793 258.793c-3.724 3.724-7.447 5.585-13.033 5.585s-9.309-1.862-13.033-5.585l-135.913-135.913v199.215c0 9.309-7.447 18.618-18.618 18.618h-366.778c-9.309 0-18.618-7.447-18.618-18.618v-698.182c0-104.262 85.644-189.905 189.905-189.905h690.735c9.309 0 18.618 7.447 18.618 18.618v366.778c0 9.309-7.447 18.618-18.618 18.618zM467.316 628.596l230.865-230.865-126.604-126.604-104.262 104.262v253.207zM467.316 187.345v137.775l78.196-78.196-80.058-80.058c0 5.585 1.862 13.033 1.862 20.48zM100.538 868.771h331.404v-165.702h-331.404v165.702zM100.538 665.833h331.404v-178.735h-331.404v178.735zM100.538 449.862h331.404v-178.735h-331.404v178.735zM277.411 34.676h-22.342c-42.822 0-80.058 16.756-107.985 44.684s-44.684 67.025-44.684 107.985v48.407h331.404v-48.407c-3.724-83.782-72.611-152.669-156.393-152.669zM497.105 34.676h-107.985c18.618 14.895 35.375 31.651 48.407 52.131l59.578 59.578v-111.709zM711.215 34.676h-178.735v148.945l178.735 178.735v-327.68zM489.658 656.524l126.604 126.604 232.727-232.727-126.604-126.604-232.727 232.727zM925.324 34.676h-178.735v329.542h178.735v-329.542zM310.924 159.418c0-24.204-20.48-44.684-46.545-44.684-24.204 0-46.545 20.48-46.545 44.684 0 26.065 20.48 46.545 46.545 46.545s46.545-20.48 46.545-46.545z" />
includes/assets-manager.php CHANGED
@@ -1,688 +1,687 @@
1
- <?php
2
- /**
3
- * PA Assets Manager.
4
- */
5
-
6
- namespace PremiumAddons\Includes;
7
-
8
- use Elementor\Plugin;
9
- use PremiumAddons\Includes\Helper_Functions;
10
- use PremiumAddons\Admin\Includes\Admin_Helper;
11
-
12
- require_once PREMIUM_ADDONS_PATH . 'widgets/dep/urlopen.php';
13
-
14
- if ( ! defined( 'ABSPATH' ) ) {
15
- exit;
16
- }
17
-
18
- /**
19
- * PA Assets Manager Class.
20
- */
21
- class Assets_Manager {
22
-
23
- /**
24
- * Class Instance.
25
- *
26
- * @var object|null instance.
27
- */
28
- private static $instance = null;
29
-
30
- /**
31
- * Post Id.
32
- * Option Id.
33
- *
34
- * @var string|null post_id.
35
- */
36
- public static $post_id = null;
37
-
38
- /**
39
- * Templates ids loaded in a post.
40
- *
41
- * @var array temp_ids.
42
- */
43
- public static $temp_ids = array();
44
-
45
- /**
46
- * All elements loaded in a post.
47
- *
48
- * @var array temp_elements.
49
- */
50
- public static $temp_elements = array();
51
-
52
- /**
53
- * Is page assets updated.
54
- *
55
- * @var boolean is_updated.
56
- */
57
- public static $is_updated = null;
58
-
59
- /**
60
- * Class Constructor.
61
- */
62
- public function __construct() {
63
-
64
- add_action( 'elementor/editor/after_save', array( $this, 'handle_post_save' ), 10, 2 );
65
-
66
- // Check if the elments are cached.
67
- add_action( 'wp', array( $this, 'set_assets_vars' ) );
68
-
69
- // Save the elements on the current page.
70
- add_filter( 'elementor/frontend/builder_content_data', array( $this, 'manage_post_data' ), 10, 2 );
71
-
72
- add_action( 'wp_footer', array( $this, 'cache_post_assets' ) );
73
-
74
- add_action( 'wp_trash_post', array( $this, 'delete_cached_options' ) );
75
-
76
- }
77
-
78
- /**
79
- * Sets Edit Time upon editor save.
80
- *
81
- * @access public
82
- * @since 4.6.1
83
- */
84
- public function handle_post_save( $post_id ) {
85
-
86
- if ( wp_doing_cron() ) {
87
- return;
88
- }
89
-
90
- // The post is saved, then we need to remove the assets related to it.
91
- $this->set_post_id( $post_id );
92
- self::remove_files();
93
-
94
- update_option( 'pa_edit_time', strtotime( 'now' ) );
95
- }
96
-
97
- /**
98
- * Mange Post Data.
99
- *
100
- * @access public
101
- * @since 4.6.1
102
- *
103
- * @param array $data post data.
104
- * @param int|string $post_id post id.
105
- *
106
- * @return array
107
- */
108
- public function manage_post_data( $data, $post_id ) {
109
-
110
- if ( ! self::$is_updated ) {
111
- $pa_elems = $this->extract_pa_elements( $data );
112
-
113
- self::$temp_ids[] = $post_id;
114
- self::$temp_elements = array_unique( array_merge( self::$temp_elements, $pa_elems ) );
115
- }
116
-
117
- return $data;
118
- }
119
-
120
- /**
121
- * Set post unique id.
122
- *
123
- * @access public
124
- * @since 4.6.1
125
- *
126
- * @param int|string $id post id.
127
- */
128
- public function set_post_id( $id = 'default' ) {
129
-
130
- $post_id = 'default' === $id ? 'pa_assets_' . get_queried_object_id() : 'pa_assets_' . $id;
131
-
132
- if ( null === self::$post_id ) {
133
- self::$post_id = Helper_Functions::generate_unique_id( $post_id );
134
- }
135
- }
136
-
137
- /**
138
- * Extracts PA Elements.
139
- *
140
- * @access public
141
- * @since 4.6.1
142
- *
143
- * @param array $data post data.
144
- *
145
- * @return array
146
- */
147
- public function extract_pa_elements( $data ) {
148
-
149
- if ( empty( $data ) ) {
150
- return array();
151
- }
152
-
153
- $pa_names = Admin_Helper::get_pa_elements_names();
154
-
155
- $social_revs = array(
156
- 'premium-yelp-reviews',
157
- 'premium-google-reviews',
158
- 'premium-facebook-reviews',
159
- 'premium-trustpilot-reviews',
160
- );
161
-
162
- $pa_elems = array();
163
-
164
- Plugin::$instance->db->iterate_data(
165
- $data,
166
- function ( $element ) use ( &$pa_elems, $pa_names, $social_revs ) {
167
-
168
- if ( isset( $element['elType'] ) ) {
169
-
170
- if ( 'widget' === $element['elType'] && isset( $element['widgetType'] ) ) {
171
-
172
- $widget_type = ( 'global' === $element['widgetType'] && ! empty( $element['templateID'] ) ) ? $this->get_global_widget_type( $element['templateID'] ) : $element['widgetType'];
173
-
174
- if ( in_array( $widget_type, $pa_names, true ) && ! in_array( $widget_type, $pa_elems, true ) ) {
175
-
176
- $widget_type = in_array( $widget_type, $social_revs, true ) ? 'premium-reviews' : $widget_type;
177
-
178
- if ( in_array( $widget_type, array( 'premium-twitter-feed', 'premium-facebook-feed' ), true ) && ! in_array( 'social-common', $pa_elems, true ) ) {
179
- array_push( $pa_elems, 'social-common' );
180
- }
181
-
182
- array_push( $pa_elems, $widget_type );
183
-
184
- if ( 'premium-woo-products' === $widget_type ) {
185
- $papro_activated = apply_filters( 'papro_activated', false );
186
-
187
- if ( $papro_activated ) {
188
- array_push( $pa_elems, 'premium-woo-products-pro' );
189
- }
190
- }
191
- }
192
- }
193
- }
194
- }
195
- );
196
-
197
- return $pa_elems;
198
- }
199
-
200
- /**
201
- * Get Global Wiget Type.
202
- *
203
- * @access public
204
- * @since 4.6.1
205
- * @link https://code.elementor.com/methods/elementor-templatelibrary-manager-get_template_data/
206
- * @param int $temp_id template it.
207
- *
208
- * @return string|void
209
- */
210
- public function get_global_widget_type( $temp_id ) {
211
-
212
- $temp_data = Plugin::$instance->templates_manager->get_template_data(
213
- array(
214
- 'source' => 'local',
215
- 'template_id' => $temp_id,
216
- )
217
- );
218
-
219
- if ( is_wp_error( $temp_data ) || ! $temp_data || empty( $temp_data ) ) {
220
- return;
221
- }
222
-
223
- if ( ! isset( $temp_data['content'] ) || empty( $temp_data['content'] ) ) {
224
- return;
225
- }
226
-
227
- return $temp_data['content'][0]['widgetType'];
228
- }
229
-
230
- /**
231
- * Sets Assets Variables.
232
- * Sets Post ID & Is_updated Flag.
233
- *
234
- * @access public
235
- * @since 4.6.1
236
- */
237
- public function set_assets_vars() {
238
-
239
- $is_edit_mode = Helper_Functions::is_edit_mode();
240
-
241
- if ( ! $this->is_built_with_elementor() || $is_edit_mode ) {
242
- return;
243
- }
244
-
245
- $this->set_post_id();
246
-
247
- self::$is_updated = self::is_ready_for_generate();
248
- }
249
-
250
- /**
251
- * Is Built With Elementor.
252
- *
253
- * @access public
254
- * @since 4.6.1
255
- *
256
- * @return boolean
257
- */
258
- public function is_built_with_elementor() {
259
-
260
- if ( ! class_exists( 'Elementor\Plugin' ) ) {
261
- return false;
262
- }
263
-
264
- $current_id = get_the_ID();
265
-
266
- if ( ! $current_id ) {
267
- return false;
268
- }
269
-
270
- return Plugin::$instance->documents->get( get_the_ID() )->is_built_with_elementor();
271
- }
272
-
273
- /**
274
- * Check if assets is updated.
275
- *
276
- * @access public
277
- * @since 4.6.1
278
- *
279
- * @return boolean
280
- */
281
- public static function is_ready_for_generate() {
282
-
283
- $editor_time = get_option( 'pa_edit_time', false );
284
-
285
- // If no post/page was saved after the feature is enabled.
286
- if ( ! $editor_time ) {
287
- update_option( 'pa_edit_time', strtotime( 'now' ) );
288
- }
289
-
290
- $post_edit_time = get_option( 'pa_edit_' . self::$post_id, false );
291
-
292
- // If the time of the last update is not equal to the time the current post was last changed. This means another post was saved, then load the default assets.
293
- // In this case, we need to load the default assets until the elements in the page needs to be cached first.
294
- if ( ! $post_edit_time || (int) $editor_time !== (int) $post_edit_time ) {
295
- // A change was made in the page elements, then we need to force the assets to be regenerated
296
- self::remove_files();
297
- return false;
298
- }
299
-
300
- return true;
301
- }
302
-
303
- /**
304
- * Cached post assets.
305
- *
306
- * Update post options in db on page load.
307
- *
308
- * @access public
309
- * @since 4.6.1
310
- */
311
- public function cache_post_assets() {
312
-
313
- $is_edit_mode = Helper_Functions::is_edit_mode();
314
- $cond = $this->is_built_with_elementor() && ! $is_edit_mode;
315
-
316
- if ( ! self::$is_updated && $cond ) {
317
- update_option( 'pa_elements_' . self::$post_id, self::$temp_elements, false );
318
- update_option( 'pa_edit_' . self::$post_id, get_option( 'pa_edit_time' ), false );
319
- }
320
- }
321
-
322
- /**
323
- * Delete Cached Options.
324
- * Delete post options from db on post delete.
325
- *
326
- * @access public
327
- * @since 4.6.1
328
- *
329
- * @param int $post_id post id.
330
- */
331
- public function delete_cached_options( $post_id ) {
332
-
333
- $id = substr( md5( 'pa_assets_' . $post_id ), 0, 9 );
334
-
335
- delete_option( 'pa_elements_' . $id );
336
- delete_option( 'pa_edit_' . $id );
337
-
338
- }
339
-
340
- /**
341
- * Generate Assets files.
342
- * Adds assets into pa-frontend(|-rtl).min.(js|css).
343
- *
344
- * @access public
345
- * @since 4.6.1
346
- *
347
- * @param string $ext assets extensions (js|css).
348
- */
349
- public static function generate_asset_file( $ext ) {
350
-
351
- $direction = is_rtl() && 'css' === $ext ? 'rtl-' : '';
352
- $main_file_name = Helper_Functions::get_safe_path( PREMIUM_ASSETS_PATH . '/pa-frontend-' . $direction . self::$post_id . '.min.' . $ext );
353
-
354
- // If the file already exists, then there is no need to regenerate a new one.
355
- if ( file_exists( $main_file_name ) ) {
356
- return;
357
- }
358
-
359
- $content = self::get_asset_file_content( $ext );
360
-
361
- // If no premium elements exist on the page, then don't generate files
362
- if ( empty( $content ) ) {
363
- return;
364
- }
365
-
366
- if ( 'css' === $ext && is_rtl() ) {
367
- $rtl_file_name = Helper_Functions::get_safe_path( PREMIUM_ASSETS_PATH . '/pa-frontend-rtl-' . self::$post_id . '.min.css' );
368
- }
369
-
370
- if ( ! file_exists( PREMIUM_ASSETS_PATH ) ) {
371
- wp_mkdir_p( PREMIUM_ASSETS_PATH );
372
- }
373
-
374
- if ( 'css' === $ext ) {
375
-
376
- if ( is_rtl() ) {
377
- // Make sure to delete the file before creating the new one.
378
- file_put_contents( $rtl_file_name, '@charset "UTF-8";' . $content['rtl'] ); // phpcs:ignore
379
- } else {
380
- file_put_contents( $main_file_name, '@charset "UTF-8";' . $content['main'] ); // phpcs:ignore
381
- }
382
- } else {
383
- file_put_contents( $main_file_name, $content ); // phpcs:ignore
384
- }
385
- }
386
-
387
-
388
- /**
389
- * Clear cached file.
390
- * Delete file if it exists.
391
- *
392
- * @access public
393
- * @since 4.6.1
394
- *
395
- * @param string $file_name file name.
396
- */
397
- public static function clear_cached_file( $file_name ) {
398
-
399
- if ( file_exists( $file_name ) ) {
400
- unlink( $file_name );
401
- }
402
- }
403
-
404
- /**
405
- * Remove files
406
- *
407
- * @since 4.6.1
408
- */
409
- public static function remove_files() {
410
-
411
- $ext = array( 'css', 'js' );
412
-
413
- foreach ( $ext as $e ) {
414
-
415
- $path = PREMIUM_ASSETS_PATH . '/pa-frontend-' . self::$post_id . '.min.' . $e;
416
-
417
- if ( 'css' === $e ) {
418
- $rtl_path = PREMIUM_ASSETS_PATH . '/pa-frontend-rtl-' . self::$post_id . '.min.' . $e;
419
- self::clear_cached_file( $rtl_path );
420
- }
421
-
422
- self::clear_cached_file( $path );
423
- }
424
-
425
- }
426
-
427
- /**
428
- * Get Asset File Content.
429
- *
430
- * Collects pa/papro widgets assets.
431
- *
432
- * @access public
433
- * @since 4.6.1
434
- *
435
- * @param string $ext js|css.
436
- *
437
- * @return string|array $content
438
- */
439
- public static function get_asset_file_content( $ext ) {
440
-
441
- // Get the cached elements of the current post/page.
442
- $pa_elements = get_option( 'pa_elements_' . self::$post_id, array() );
443
-
444
- if ( empty( $pa_elements ) ) {
445
- return '';
446
- }
447
-
448
- $content = '';
449
-
450
- if ( 'css' === $ext ) {
451
- $rtl_content = '';
452
- }
453
-
454
- $pa_elements = self::prepare_pa_elements( $pa_elements, $ext );
455
-
456
- foreach ( $pa_elements as $element ) {
457
-
458
- $path = self::get_file_path( $element, $ext );
459
-
460
- if ( ! $path ) {
461
- continue;
462
- }
463
-
464
- $content .= self::get_file_content( $path );
465
-
466
- if ( 'css' === $ext && is_rtl() ) {
467
- $rtl_path = self::get_file_path( $element, $ext, '-rtl' );
468
- $rtl_content .= self::get_file_content( $rtl_path );
469
- }
470
- }
471
-
472
- if ( 'css' === $ext ) {
473
-
474
- $content = array(
475
- 'main' => $content,
476
- 'rtl' => $rtl_content,
477
- );
478
-
479
- // Fix: at-rule or selector expected css error.
480
- $content = str_replace( '@charset "UTF-8";', '', $content );
481
- }
482
-
483
- return $content;
484
- }
485
-
486
- /**
487
- * Prepare PA Elements.
488
- *
489
- * @access public
490
- * @since 4.6.1
491
- *
492
- * @param array $elements post elements.
493
- * @param string $ext js|css.
494
- *
495
- * @return array
496
- */
497
- public static function prepare_pa_elements( $elements, $ext ) {
498
-
499
- if ( 'css' === $ext ) {
500
- $common_assets = self::has_free_elements( $elements ) ? array( 'common' ) : array();
501
- $common_assets = self::has_pro_elements( $elements ) ? array_merge( $common_assets, array( 'common-pro' ) ) : $common_assets;
502
-
503
- $elements = array_merge( $elements, $common_assets );
504
-
505
- } else {
506
- $indep_elements = array(
507
- 'social-common',
508
- 'premium-hscroll',
509
- 'premium-lottie',
510
- 'premium-vscroll',
511
- 'premium-addon-maps',
512
- 'premium-woo-products-pro',
513
- 'premium-addon-testimonials',
514
- 'premium-addon-pricing-table',
515
- 'premium-addon-image-separator',
516
- );
517
-
518
- $elements = array_diff( $elements, $indep_elements );
519
- }
520
-
521
- return $elements;
522
- }
523
-
524
- /**
525
- * Get File Content.
526
- *
527
- * @param string $path file path.
528
- *
529
- * @return string
530
- */
531
- public static function get_file_content( $path ) {
532
-
533
- $file_content = rplg_urlopen( $path );
534
-
535
- if ( isset( $file_content['code'] ) ) {
536
- if ( 404 === $file_content['code'] ) {
537
- return '';
538
- }
539
- }
540
-
541
- return self::clean_content( $file_content['data'] );
542
- }
543
-
544
- /**
545
- * Clean Content
546
- * Removes Page Html if it's returned as result.
547
- *
548
- * @param string $content file content.
549
- *
550
- * @return string
551
- */
552
- public static function clean_content( $content ) {
553
-
554
- if ( strpos( $content, '<!DOCTYPE html>' ) ) {
555
- $content = explode( '<!DOCTYPE html>', $content )[0];
556
- }
557
-
558
- if ( strpos( $content, '<!doctype html>' ) ) {
559
- $content = explode( '<!doctype html>', $content )[0];
560
- }
561
-
562
- return $content;
563
- }
564
-
565
- /**
566
- * Get File Path.
567
- * Construct file path.
568
- *
569
- * @param string $element pa element name.
570
- * @param string $ext file extension ( js|css).
571
- * @param string $dir post dir (-rtl|'').
572
- *
573
- * @return string file path.
574
- */
575
- public static function get_file_path( $element, $ext, $dir = '' ) {
576
-
577
- $is_pro = self::is_pro_widget( $element );
578
-
579
- $papro_activated = apply_filters( 'papro_activated', false ) && version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.7.1', '>' );
580
-
581
- if ( ! $papro_activated && $is_pro ) {
582
- return false;
583
- }
584
-
585
- $element = str_replace( '-addon', '', $element );
586
-
587
- $path = $is_pro ? PREMIUM_PRO_ADDONS_URL : PREMIUM_ADDONS_URL;
588
-
589
- return $path . 'assets/frontend/min-' . $ext . '/' . $element . $dir . '.min.' . $ext;
590
- }
591
-
592
- /**
593
- * Is Pro Widget.
594
- * Checks if the widget is pro.
595
- *
596
- * @access public
597
- * @since 4.6.1
598
- *
599
- * @param string $widget widget name.
600
- *
601
- * @return bool
602
- */
603
- public static function is_pro_widget( $widget ) {
604
-
605
- $pro_names = array_merge( array( 'common-pro', 'premium-reviews', 'premium-woo-products-pro', 'social-common' ), self::get_pro_widgets_names() );
606
-
607
- return in_array( $widget, $pro_names, true );
608
- }
609
-
610
- /**
611
- * Has Pro Elements.
612
- * Check if the post has pa pro elements.
613
- *
614
- * @access public
615
- * @since 4.6.1
616
- *
617
- * @param array $post_elems post elements.
618
- *
619
- * @return boolean
620
- */
621
- public static function has_pro_elements( $post_elems ) {
622
-
623
- $papro_elems = self::get_pro_widgets_names();
624
- $has_pro = array_intersect( $post_elems, $papro_elems ) ? true : false;
625
-
626
- return $has_pro;
627
- }
628
-
629
- /**
630
- * Has Free Elements.
631
- * Check if the post has pa elements.
632
- *
633
- * @access public
634
- * @since 4.6.1
635
- *
636
- * @param array $post_elems post elements.
637
- *
638
- * @return boolean
639
- */
640
- public static function has_free_elements( $post_elems ) {
641
-
642
- $pa_elems = Admin_Helper::get_free_widgets_names();
643
- $has_free = array_intersect( $post_elems, $pa_elems ) ? true : false;
644
-
645
- return $has_free;
646
- }
647
-
648
- /**
649
- * Get Pro Widgets Names.
650
- *
651
- * @access public
652
- * @since 4.6.1
653
- *
654
- * @return array
655
- */
656
- public static function get_pro_widgets_names() {
657
-
658
- $pro_elems = Admin_Helper::get_pro_elements();
659
- $pro_names = array();
660
-
661
- foreach ( $pro_elems as $element ) {
662
- if ( isset( $element['name'] ) ) {
663
- array_push( $pro_names, $element['name'] );
664
- }
665
- }
666
-
667
- return $pro_names;
668
- }
669
-
670
- /**
671
- * Creates and returns an instance of the class.
672
- *
673
- * @since 4.6.1
674
- * @access public
675
- *
676
- * @return object
677
- */
678
- public static function get_instance() {
679
-
680
- if ( ! isset( self::$instance ) ) {
681
-
682
- self::$instance = new self();
683
-
684
- }
685
-
686
- return self::$instance;
687
- }
688
- }
1
+ <?php
2
+ /**
3
+ * PA Assets Manager.
4
+ */
5
+
6
+ namespace PremiumAddons\Includes;
7
+
8
+ use Elementor\Plugin;
9
+ use PremiumAddons\Includes\Helper_Functions;
10
+ use PremiumAddons\Admin\Includes\Admin_Helper;
11
+
12
+ require_once PREMIUM_ADDONS_PATH . 'widgets/dep/urlopen.php';
13
+
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ exit;
16
+ }
17
+
18
+ /**
19
+ * PA Assets Manager Class.
20
+ */
21
+ class Assets_Manager {
22
+
23
+ /**
24
+ * Class Instance.
25
+ *
26
+ * @var object|null instance.
27
+ */
28
+ private static $instance = null;
29
+
30
+ /**
31
+ * Post Id.
32
+ * Option Id.
33
+ *
34
+ * @var string|null post_id.
35
+ */
36
+ public static $post_id = null;
37
+
38
+ /**
39
+ * Templates ids loaded in a post.
40
+ *
41
+ * @var array temp_ids.
42
+ */
43
+ public static $temp_ids = array();
44
+
45
+ /**
46
+ * All elements loaded in a post.
47
+ *
48
+ * @var array temp_elements.
49
+ */
50
+ public static $temp_elements = array();
51
+
52
+ /**
53
+ * Is page assets updated.
54
+ *
55
+ * @var boolean is_updated.
56
+ */
57
+ public static $is_updated = null;
58
+
59
+ /**
60
+ * Class Constructor.
61
+ */
62
+ public function __construct() {
63
+
64
+ add_action( 'elementor/editor/after_save', array( $this, 'handle_post_save' ), 10, 2 );
65
+
66
+ // Check if the elments are cached.
67
+ add_action( 'wp', array( $this, 'set_assets_vars' ) );
68
+
69
+ // Save the elements on the current page.
70
+ add_filter( 'elementor/frontend/builder_content_data', array( $this, 'manage_post_data' ), 10, 2 );
71
+
72
+ add_action( 'wp_footer', array( $this, 'cache_post_assets' ) );
73
+
74
+ add_action( 'wp_trash_post', array( $this, 'delete_cached_options' ) );
75
+
76
+ }
77
+
78
+ /**
79
+ * Sets Edit Time upon editor save.
80
+ *
81
+ * @access public
82
+ * @since 4.6.1
83
+ */
84
+ public function handle_post_save( $post_id ) {
85
+
86
+ if ( wp_doing_cron() ) {
87
+ return;
88
+ }
89
+
90
+ // The post is saved, then we need to remove the assets related to it.
91
+ $this->set_post_id( $post_id );
92
+ self::remove_files();
93
+
94
+ update_option( 'pa_edit_time', strtotime( 'now' ) );
95
+ }
96
+
97
+ /**
98
+ * Mange Post Data.
99
+ *
100
+ * @access public
101
+ * @since 4.6.1
102
+ *
103
+ * @param array $data post data.
104
+ * @param int|string $post_id post id.
105
+ *
106
+ * @return array
107
+ */
108
+ public function manage_post_data( $data, $post_id ) {
109
+
110
+ if ( ! self::$is_updated ) {
111
+ $pa_elems = $this->extract_pa_elements( $data );
112
+
113
+ self::$temp_ids[] = $post_id;
114
+ self::$temp_elements = array_unique( array_merge( self::$temp_elements, $pa_elems ) );
115
+ }
116
+
117
+ return $data;
118
+ }
119
+
120
+ /**
121
+ * Set post unique id.
122
+ *
123
+ * @access public
124
+ * @since 4.6.1
125
+ *
126
+ * @param int|string $id post id.
127
+ */
128
+ public function set_post_id( $id = 'default' ) {
129
+
130
+ $post_id = 'default' === $id ? 'pa_assets_' . get_queried_object_id() : 'pa_assets_' . $id;
131
+
132
+ if ( null === self::$post_id ) {
133
+ self::$post_id = Helper_Functions::generate_unique_id( $post_id );
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Extracts PA Elements.
139
+ *
140
+ * @access public
141
+ * @since 4.6.1
142
+ *
143
+ * @param array $data post data.
144
+ *
145
+ * @return array
146
+ */
147
+ public function extract_pa_elements( $data ) {
148
+
149
+ if ( empty( $data ) ) {
150
+ return array();
151
+ }
152
+
153
+ $pa_names = Admin_Helper::get_pa_elements_names();
154
+
155
+ $social_revs = array(
156
+ 'premium-yelp-reviews',
157
+ 'premium-google-reviews',
158
+ 'premium-facebook-reviews',
159
+ );
160
+
161
+ $pa_elems = array();
162
+
163
+ Plugin::$instance->db->iterate_data(
164
+ $data,
165
+ function ( $element ) use ( &$pa_elems, $pa_names, $social_revs ) {
166
+
167
+ if ( isset( $element['elType'] ) ) {
168
+
169
+ if ( 'widget' === $element['elType'] && isset( $element['widgetType'] ) ) {
170
+
171
+ $widget_type = ( 'global' === $element['widgetType'] && ! empty( $element['templateID'] ) ) ? $this->get_global_widget_type( $element['templateID'] ) : $element['widgetType'];
172
+
173
+ if ( in_array( $widget_type, $pa_names, true ) && ! in_array( $widget_type, $pa_elems, true ) ) {
174
+
175
+ $widget_type = in_array( $widget_type, $social_revs, true ) ? 'premium-reviews' : $widget_type;
176
+
177
+ if ( in_array( $widget_type, array( 'premium-twitter-feed', 'premium-facebook-feed' ), true ) && ! in_array( 'social-common', $pa_elems, true ) ) {
178
+ array_push( $pa_elems, 'social-common' );
179
+ }
180
+
181
+ array_push( $pa_elems, $widget_type );
182
+
183
+ if ( 'premium-woo-products' === $widget_type ) {
184
+ $papro_activated = apply_filters( 'papro_activated', false );
185
+
186
+ if ( $papro_activated ) {
187
+ array_push( $pa_elems, 'premium-woo-products-pro' );
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }
193
+ }
194
+ );
195
+
196
+ return $pa_elems;
197
+ }
198
+
199
+ /**
200
+ * Get Global Wiget Type.
201
+ *
202
+ * @access public
203
+ * @since 4.6.1
204
+ * @link https://code.elementor.com/methods/elementor-templatelibrary-manager-get_template_data/
205
+ * @param int $temp_id template it.
206
+ *
207
+ * @return string|void
208
+ */
209
+ public function get_global_widget_type( $temp_id ) {
210
+
211
+ $temp_data = Plugin::$instance->templates_manager->get_template_data(
212
+ array(
213
+ 'source' => 'local',
214
+ 'template_id' => $temp_id,
215
+ )
216
+ );
217
+
218
+ if ( is_wp_error( $temp_data ) || ! $temp_data || empty( $temp_data ) ) {
219
+ return;
220
+ }
221
+
222
+ if ( ! isset( $temp_data['content'] ) || empty( $temp_data['content'] ) ) {
223
+ return;
224
+ }
225
+
226
+ return $temp_data['content'][0]['widgetType'];
227
+ }
228
+
229
+ /**
230
+ * Sets Assets Variables.
231
+ * Sets Post ID & Is_updated Flag.
232
+ *
233
+ * @access public
234
+ * @since 4.6.1
235
+ */
236
+ public function set_assets_vars() {
237
+
238
+ $is_edit_mode = Helper_Functions::is_edit_mode();
239
+
240
+ if ( ! $this->is_built_with_elementor() || $is_edit_mode ) {
241
+ return;
242
+ }
243
+
244
+ $this->set_post_id();
245
+
246
+ self::$is_updated = self::is_ready_for_generate();
247
+ }
248
+
249
+ /**
250
+ * Is Built With Elementor.
251
+ *
252
+ * @access public
253
+ * @since 4.6.1
254
+ *
255
+ * @return boolean
256
+ */
257
+ public function is_built_with_elementor() {
258
+
259
+ if ( ! class_exists( 'Elementor\Plugin' ) ) {
260
+ return false;
261
+ }
262
+
263
+ $current_id = get_the_ID();
264
+
265
+ if ( ! $current_id ) {
266
+ return false;
267
+ }
268
+
269
+ return Plugin::$instance->documents->get( get_the_ID() )->is_built_with_elementor();
270
+ }
271
+
272
+ /**
273
+ * Check if assets is updated.
274
+ *
275
+ * @access public
276
+ * @since 4.6.1
277
+ *
278
+ * @return boolean
279
+ */
280
+ public static function is_ready_for_generate() {
281
+
282
+ $editor_time = get_option( 'pa_edit_time', false );
283
+
284
+ // If no post/page was saved after the feature is enabled.
285
+ if ( ! $editor_time ) {
286
+ update_option( 'pa_edit_time', strtotime( 'now' ) );
287
+ }
288
+
289
+ $post_edit_time = get_option( 'pa_edit_' . self::$post_id, false );
290
+
291
+ // If the time of the last update is not equal to the time the current post was last changed. This means another post was saved, then load the default assets.
292
+ // In this case, we need to load the default assets until the elements in the page needs to be cached first.
293
+ if ( ! $post_edit_time || (int) $editor_time !== (int) $post_edit_time ) {
294
+ // A change was made in the page elements, then we need to force the assets to be regenerated
295
+ self::remove_files();
296
+ return false;
297
+ }
298
+
299
+ return true;
300
+ }
301
+
302
+ /**
303
+ * Cached post assets.
304
+ *
305
+ * Update post options in db on page load.
306
+ *
307
+ * @access public
308
+ * @since 4.6.1
309
+ */
310
+ public function cache_post_assets() {
311
+
312
+ $is_edit_mode = Helper_Functions::is_edit_mode();
313
+ $cond = $this->is_built_with_elementor() && ! $is_edit_mode;
314
+
315
+ if ( ! self::$is_updated && $cond ) {
316
+ update_option( 'pa_elements_' . self::$post_id, self::$temp_elements, false );
317
+ update_option( 'pa_edit_' . self::$post_id, get_option( 'pa_edit_time' ), false );
318
+ }
319
+ }
320
+
321
+ /**
322
+ * Delete Cached Options.
323
+ * Delete post options from db on post delete.
324
+ *
325
+ * @access public
326
+ * @since 4.6.1
327
+ *
328
+ * @param int $post_id post id.
329
+ */
330
+ public function delete_cached_options( $post_id ) {
331
+
332
+ $id = substr( md5( 'pa_assets_' . $post_id ), 0, 9 );
333
+
334
+ delete_option( 'pa_elements_' . $id );
335
+ delete_option( 'pa_edit_' . $id );
336
+
337
+ }
338
+
339
+ /**
340
+ * Generate Assets files.
341
+ * Adds assets into pa-frontend(|-rtl).min.(js|css).
342
+ *
343
+ * @access public
344
+ * @since 4.6.1
345
+ *
346
+ * @param string $ext assets extensions (js|css).
347
+ */
348
+ public static function generate_asset_file( $ext ) {
349
+
350
+ $direction = is_rtl() && 'css' === $ext ? 'rtl-' : '';
351
+ $main_file_name = Helper_Functions::get_safe_path( PREMIUM_ASSETS_PATH . '/pa-frontend-' . $direction . self::$post_id . '.min.' . $ext );
352
+
353
+ // If the file already exists, then there is no need to regenerate a new one.
354
+ if ( file_exists( $main_file_name ) ) {
355
+ return;
356
+ }
357
+
358
+ $content = self::get_asset_file_content( $ext );
359
+
360
+ // If no premium elements exist on the page, then don't generate files
361
+ if ( empty( $content ) ) {
362
+ return;
363
+ }
364
+
365
+ if ( 'css' === $ext && is_rtl() ) {
366
+ $rtl_file_name = Helper_Functions::get_safe_path( PREMIUM_ASSETS_PATH . '/pa-frontend-rtl-' . self::$post_id . '.min.css' );
367
+ }
368
+
369
+ if ( ! file_exists( PREMIUM_ASSETS_PATH ) ) {
370
+ wp_mkdir_p( PREMIUM_ASSETS_PATH );
371
+ }
372
+
373
+ if ( 'css' === $ext ) {
374
+
375
+ if ( is_rtl() ) {
376
+ // Make sure to delete the file before creating the new one.
377
+ file_put_contents( $rtl_file_name, '@charset "UTF-8";' . $content['rtl'] ); // phpcs:ignore
378
+ } else {
379
+ file_put_contents( $main_file_name, '@charset "UTF-8";' . $content['main'] ); // phpcs:ignore
380
+ }
381
+ } else {
382
+ file_put_contents( $main_file_name, $content ); // phpcs:ignore
383
+ }
384
+ }
385
+
386
+
387
+ /**
388
+ * Clear cached file.
389
+ * Delete file if it exists.
390
+ *
391
+ * @access public
392
+ * @since 4.6.1
393
+ *
394
+ * @param string $file_name file name.
395
+ */
396
+ public static function clear_cached_file( $file_name ) {
397
+
398
+ if ( file_exists( $file_name ) ) {
399
+ unlink( $file_name );
400
+ }
401
+ }
402
+
403
+ /**
404
+ * Remove files
405
+ *
406
+ * @since 4.6.1
407
+ */
408
+ public static function remove_files() {
409
+
410
+ $ext = array( 'css', 'js' );
411
+
412
+ foreach ( $ext as $e ) {
413
+
414
+ $path = PREMIUM_ASSETS_PATH . '/pa-frontend-' . self::$post_id . '.min.' . $e;
415
+
416
+ if ( 'css' === $e ) {
417
+ $rtl_path = PREMIUM_ASSETS_PATH . '/pa-frontend-rtl-' . self::$post_id . '.min.' . $e;
418
+ self::clear_cached_file( $rtl_path );
419
+ }
420
+
421
+ self::clear_cached_file( $path );
422
+ }
423
+
424
+ }
425
+
426
+ /**
427
+ * Get Asset File Content.
428
+ *
429
+ * Collects pa/papro widgets assets.
430
+ *
431
+ * @access public
432
+ * @since 4.6.1
433
+ *
434
+ * @param string $ext js|css.
435
+ *
436
+ * @return string|array $content
437
+ */
438
+ public static function get_asset_file_content( $ext ) {
439
+
440
+ // Get the cached elements of the current post/page.
441
+ $pa_elements = get_option( 'pa_elements_' . self::$post_id, array() );
442
+
443
+ if ( empty( $pa_elements ) ) {
444
+ return '';
445
+ }
446
+
447
+ $content = '';
448
+
449
+ if ( 'css' === $ext ) {
450
+ $rtl_content = '';
451
+ }
452
+
453
+ $pa_elements = self::prepare_pa_elements( $pa_elements, $ext );
454
+
455
+ foreach ( $pa_elements as $element ) {
456
+
457
+ $path = self::get_file_path( $element, $ext );
458
+
459
+ if ( ! $path ) {
460
+ continue;
461
+ }
462
+
463
+ $content .= self::get_file_content( $path );
464
+
465
+ if ( 'css' === $ext && is_rtl() ) {
466
+ $rtl_path = self::get_file_path( $element, $ext, '-rtl' );
467
+ $rtl_content .= self::get_file_content( $rtl_path );
468
+ }
469
+ }
470
+
471
+ if ( 'css' === $ext ) {
472
+
473
+ $content = array(
474
+ 'main' => $content,
475
+ 'rtl' => $rtl_content,
476
+ );
477
+
478
+ // Fix: at-rule or selector expected css error.
479
+ $content = str_replace( '@charset "UTF-8";', '', $content );
480
+ }
481
+
482
+ return $content;
483
+ }
484
+
485
+ /**
486
+ * Prepare PA Elements.
487
+ *
488
+ * @access public
489
+ * @since 4.6.1
490
+ *
491
+ * @param array $elements post elements.
492
+ * @param string $ext js|css.
493
+ *
494
+ * @return array
495
+ */
496
+ public static function prepare_pa_elements( $elements, $ext ) {
497
+
498
+ if ( 'css' === $ext ) {
499
+ $common_assets = self::has_free_elements( $elements ) ? array( 'common' ) : array();
500
+ $common_assets = self::has_pro_elements( $elements ) ? array_merge( $common_assets, array( 'common-pro' ) ) : $common_assets;
501
+
502
+ $elements = array_merge( $elements, $common_assets );
503
+
504
+ } else {
505
+ $indep_elements = array(
506
+ 'social-common',
507
+ 'premium-hscroll',
508
+ 'premium-lottie',
509
+ 'premium-vscroll',
510
+ 'premium-addon-maps',
511
+ 'premium-woo-products-pro',
512
+ 'premium-addon-testimonials',
513
+ 'premium-addon-pricing-table',
514
+ 'premium-addon-image-separator',
515
+ );
516
+
517
+ $elements = array_diff( $elements, $indep_elements );
518
+ }
519
+
520
+ return $elements;
521
+ }
522
+
523
+ /**
524
+ * Get File Content.
525
+ *
526
+ * @param string $path file path.
527
+ *
528
+ * @return string
529
+ */
530
+ public static function get_file_content( $path ) {
531
+
532
+ $file_content = rplg_urlopen( $path );
533
+
534
+ if ( isset( $file_content['code'] ) ) {
535
+ if ( 404 === $file_content['code'] ) {
536
+ return '';
537
+ }
538
+ }
539
+
540
+ return self::clean_content( $file_content['data'] );
541
+ }
542
+
543
+ /**
544
+ * Clean Content
545
+ * Removes Page Html if it's returned as result.
546
+ *
547
+ * @param string $content file content.
548
+ *
549
+ * @return string
550
+ */
551
+ public static function clean_content( $content ) {
552
+
553
+ if ( strpos( $content, '<!DOCTYPE html>' ) ) {
554
+ $content = explode( '<!DOCTYPE html>', $content )[0];
555
+ }
556
+
557
+ if ( strpos( $content, '<!doctype html>' ) ) {
558
+ $content = explode( '<!doctype html>', $content )[0];
559
+ }
560
+
561
+ return $content;
562
+ }
563
+
564
+ /**
565
+ * Get File Path.
566
+ * Construct file path.
567
+ *
568
+ * @param string $element pa element name.
569
+ * @param string $ext file extension ( js|css).
570
+ * @param string $dir post dir (-rtl|'').
571
+ *
572
+ * @return string file path.
573
+ */
574
+ public static function get_file_path( $element, $ext, $dir = '' ) {
575
+
576
+ $is_pro = self::is_pro_widget( $element );
577
+
578
+ $papro_activated = apply_filters( 'papro_activated', false ) && version_compare( PREMIUM_PRO_ADDONS_VERSION, '2.7.1', '>' );
579
+
580
+ if ( ! $papro_activated && $is_pro ) {
581
+ return false;
582
+ }
583
+
584
+ $element = str_replace( '-addon', '', $element );
585
+
586
+ $path = $is_pro ? PREMIUM_PRO_ADDONS_URL : PREMIUM_ADDONS_URL;
587
+
588
+ return $path . 'assets/frontend/min-' . $ext . '/' . $element . $dir . '.min.' . $ext;
589
+ }
590
+
591
+ /**
592
+ * Is Pro Widget.
593
+ * Checks if the widget is pro.
594
+ *
595
+ * @access public
596
+ * @since 4.6.1
597
+ *
598
+ * @param string $widget widget name.
599
+ *
600
+ * @return bool
601
+ */
602
+ public static function is_pro_widget( $widget ) {
603
+
604
+ $pro_names = array_merge( array( 'common-pro', 'premium-reviews', 'premium-woo-products-pro', 'social-common' ), self::get_pro_widgets_names() );
605
+
606
+ return in_array( $widget, $pro_names, true );
607
+ }
608
+
609
+ /**
610
+ * Has Pro Elements.
611
+ * Check if the post has pa pro elements.
612
+ *
613
+ * @access public
614
+ * @since 4.6.1
615
+ *
616
+ * @param array $post_elems post elements.
617
+ *
618
+ * @return boolean
619
+ */
620
+ public static function has_pro_elements( $post_elems ) {
621
+
622
+ $papro_elems = self::get_pro_widgets_names();
623
+ $has_pro = array_intersect( $post_elems, $papro_elems ) ? true : false;
624
+
625
+ return $has_pro;
626
+ }
627
+
628
+ /**
629
+ * Has Free Elements.
630
+ * Check if the post has pa elements.
631
+ *
632
+ * @access public
633
+ * @since 4.6.1
634
+ *
635
+ * @param array $post_elems post elements.
636
+ *
637
+ * @return boolean
638
+ */
639
+ public static function has_free_elements( $post_elems ) {
640
+
641
+ $pa_elems = Admin_Helper::get_free_widgets_names();
642
+ $has_free = array_intersect( $post_elems, $pa_elems ) ? true : false;
643
+
644
+ return $has_free;
645
+ }
646
+
647
+ /**
648
+ * Get Pro Widgets Names.
649
+ *
650
+ * @access public
651
+ * @since 4.6.1
652
+ *
653
+ * @return array
654
+ */
655
+ public static function get_pro_widgets_names() {
656
+
657
+ $pro_elems = Admin_Helper::get_pro_elements();
658
+ $pro_names = array();
659
+
660
+ foreach ( $pro_elems as $element ) {
661
+ if ( isset( $element['name'] ) ) {
662
+ array_push( $pro_names, $element['name'] );
663
+ }
664
+ }
665
+
666
+ return $pro_names;
667
+ }
668
+
669
+ /**
670
+ * Creates and returns an instance of the class.
671
+ *
672
+ * @since 4.6.1
673
+ * @access public
674
+ *
675
+ * @return object
676
+ */
677
+ public static function get_instance() {
678
+
679
+ if ( ! isset( self::$instance ) ) {
680
+
681
+ self::$instance = new self();
682
+
683
+ }
684
+
685
+ return self::$instance;
686
+ }
687
+ }
 
languages/premium-addons-for-elementor.pot CHANGED
@@ -354,10 +354,6 @@ msgstr ""
354
  msgid "Yelp Reviews"
355
  msgstr ""
356
 
357
- #: admin/includes/elements.php:347 admin/includes/elements.php:872
358
- msgid "Trustpilot Reviews"
359
- msgstr ""
360
-
361
  #: admin/includes/elements.php:358 admin/includes/elements.php:887
362
  #: widgets/premium-countdown.php:51 widgets/premium-countdown.php:152
363
  msgid "Countdown"
354
  msgid "Yelp Reviews"
355
  msgstr ""
356
 
 
 
 
 
357
  #: admin/includes/elements.php:358 admin/includes/elements.php:887
358
  #: widgets/premium-countdown.php:51 widgets/premium-countdown.php:152
359
  msgid "Countdown"
premium-addons-for-elementor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
5
  Plugin URI: https://premiumaddons.com
6
- Version: 4.9.8
7
  Elementor tested up to: 3.6.4
8
  Elementor Pro tested up to: 3.6.5
9
  Author: Leap13
@@ -18,14 +18,14 @@ if ( ! defined( 'ABSPATH' ) ) {
18
  }
19
 
20
  // Define Constants.
21
- define( 'PREMIUM_ADDONS_VERSION', '4.9.8' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ASSETS_PATH', set_url_scheme( wp_upload_dir()['basedir'] . '/premium-addons-elementor' ) );
25
  define( 'PREMIUM_ASSETS_URL', set_url_scheme( wp_upload_dir()['baseurl'] . '/premium-addons-elementor' ) );
26
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
27
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
28
- define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.9.6' );
29
 
30
  /*
31
  * Load plugin core file
3
  Plugin Name: Premium Addons for Elementor
4
  Description: Premium Addons for Elementor plugin includes widgets and addons like Blog Post Grid, Gallery, Carousel, Modal Popup, Google Maps, Pricing Tables, Lottie Animations, Countdown, Testimonials.
5
  Plugin URI: https://premiumaddons.com
6
+ Version: 4.9.9
7
  Elementor tested up to: 3.6.4
8
  Elementor Pro tested up to: 3.6.5
9
  Author: Leap13
18
  }
19
 
20
  // Define Constants.
21
+ define( 'PREMIUM_ADDONS_VERSION', '4.9.9' );
22
  define( 'PREMIUM_ADDONS_URL', plugins_url( '/', __FILE__ ) );
23
  define( 'PREMIUM_ADDONS_PATH', plugin_dir_path( __FILE__ ) );
24
  define( 'PREMIUM_ASSETS_PATH', set_url_scheme( wp_upload_dir()['basedir'] . '/premium-addons-elementor' ) );
25
  define( 'PREMIUM_ASSETS_URL', set_url_scheme( wp_upload_dir()['baseurl'] . '/premium-addons-elementor' ) );
26
  define( 'PREMIUM_ADDONS_FILE', __FILE__ );
27
  define( 'PREMIUM_ADDONS_BASENAME', plugin_basename( PREMIUM_ADDONS_FILE ) );
28
+ define( 'PREMIUM_ADDONS_STABLE_VERSION', '4.9.8' );
29
 
30
  /*
31
  * Load plugin core file
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate Link: https://premiumaddons.com/?utm_source=wp-repo&utm_medium=link&utm_c
5
  Requires at least: 5.0
6
  Tested Up To: 5.9.3
7
  Requires PHP: 5.4
8
- Stable Tag: 4.9.8
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
@@ -212,6 +212,10 @@ Premium Addons for Elementor is 100% Ads Free, Ads can only be detected from You
212
 
213
  == Changelog ==
214
 
 
 
 
 
215
  = 4.9.8 =
216
 
217
  - Fixed: Fatal PHP error with Premium Nav Menu widget.
@@ -567,7 +571,7 @@ Tweak: JS code optimized for security improvements.
567
 
568
  = 4.3.6 =
569
 
570
- - Tweak: Premium Trustpilot Reviews switcher changed to disabled by default.
571
 
572
  = 4.3.5 =
573
 
5
  Requires at least: 5.0
6
  Tested Up To: 5.9.3
7
  Requires PHP: 5.4
8
+ Stable Tag: 4.9.9
9
  License: GPL v3.0
10
  License URI: https://opensource.org/licenses/GPL-3.0
11
 
212
 
213
  == Changelog ==
214
 
215
+ = 4.9.9 =
216
+
217
+ - Tweak: Added WPML compatibility for Nav/Mega Menu widget.
218
+
219
  = 4.9.8 =
220
 
221
  - Fixed: Fatal PHP error with Premium Nav Menu widget.
571
 
572
  = 4.3.6 =
573
 
574
+ - Tweak: Code improvements for better performance.
575
 
576
  = 4.3.5 =
577
 
wpml-config.xml CHANGED
@@ -236,5 +236,17 @@
236
  <field name="Woo Products: Out Of Stock String" editor_type="LINE">sold_out_string</field>
237
  </fields>
238
  </widget>
 
 
 
 
 
 
 
 
 
 
 
 
239
  </elementor-widgets>
240
  </wpml-config>
236
  <field name="Woo Products: Out Of Stock String" editor_type="LINE">sold_out_string</field>
237
  </fields>
238
  </widget>
239
+
240
+ <widget name="premium-nav-menu">
241
+ <fields>
242
+ <field name="Mega Menu: Toggle Text" editor_type="LINE">pa_mobile_toggle_text</field>
243
+ <field name="Mega Menu: Close Text" editor_type="LINE">pa_mobile_toggle_close</field>
244
+ </fields>
245
+ <fields-in-item items_of="menu_items">
246
+ <field type="Mega Menu: Item Text" editor_type="LINE">premium_textextt_strings_text_field</field>
247
+ <field type="Mega Menu: Item Link" editor_type="LINK">link>url</field>
248
+ <field type="Mega Menu: Badge Text" editor_type="LINE">badge_text</field>
249
+ </fields-in-item>
250
+ </widget>
251
  </elementor-widgets>
252
  </wpml-config>