Completed
Pull Request — develop (#1633)
by Naveen
01:04
created
src/includes/class-wordlift.php 1 patch
Spacing   +290 added lines, -290 removed lines patch added patch discarded remove patch
@@ -639,15 +639,15 @@  discard block
 block discarded – undo
639 639
 		$that = $this;
640 640
 		add_action(
641 641
 			'plugins_loaded',
642
-			function () use ( $that ) {
643
-				$that->define_admin_hooks( $that );
644
-				$that->define_public_hooks( $that );
642
+			function() use ($that) {
643
+				$that->define_admin_hooks($that);
644
+				$that->define_public_hooks($that);
645 645
 			},
646 646
 			4
647 647
 		);
648 648
 
649 649
 		// If we're in `WP_CLI` load the related files.
650
-		if ( class_exists( 'WP_CLI' ) ) {
650
+		if (class_exists('WP_CLI')) {
651 651
 			$this->load_cli_dependencies();
652 652
 		}
653 653
 
@@ -687,329 +687,329 @@  discard block
 block discarded – undo
687 687
 		 * The class responsible for orchestrating the actions and filters of the
688 688
 		 * core plugin.
689 689
 		 */
690
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-loader.php';
690
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-loader.php';
691 691
 
692 692
 		// The class responsible for plugin uninstall.
693
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-deactivator-feedback.php';
693
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-deactivator-feedback.php';
694 694
 
695 695
 		/**
696 696
 		 * The class responsible for defining internationalization functionality
697 697
 		 * of the plugin.
698 698
 		 */
699
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-i18n.php';
699
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-i18n.php';
700 700
 
701 701
 		/**
702 702
 		 * WordLift's supported languages.
703 703
 		 */
704
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-languages.php';
704
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-languages.php';
705 705
 
706 706
 		/**
707 707
 		 * WordLift's supported countries.
708 708
 		 */
709
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-countries.php';
709
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-countries.php';
710 710
 
711 711
 		/**
712 712
 		 * Provide support functions to sanitize data.
713 713
 		 */
714
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sanitizer.php';
714
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sanitizer.php';
715 715
 
716 716
 		/** Services. */
717
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-log-service.php';
718
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-http-api.php';
719
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-redirect-service.php';
720
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-configuration-service.php';
721
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-post-type-service.php';
722
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-service.php';
723
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-link-service.php';
724
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-relation-service.php';
725
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-image-service.php';
717
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-log-service.php';
718
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-http-api.php';
719
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-redirect-service.php';
720
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-configuration-service.php';
721
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-post-type-service.php';
722
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-service.php';
723
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-link-service.php';
724
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-relation-service.php';
725
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-image-service.php';
726 726
 
727 727
 		/**
728 728
 		 * The Schema service.
729 729
 		 */
730
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-schema-service.php';
730
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-schema-service.php';
731 731
 
732 732
 		/**
733 733
 		 * The schema:url property service.
734 734
 		 */
735
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-property-service.php';
736
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-schema-url-property-service.php';
735
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-property-service.php';
736
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-schema-url-property-service.php';
737 737
 
738 738
 		/**
739 739
 		 * The UI service.
740 740
 		 */
741
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-ui-service.php';
741
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-ui-service.php';
742 742
 
743 743
 		/**
744 744
 		 * The Entity Types Taxonomy service.
745 745
 		 */
746
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
746
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-taxonomy-service.php';
747 747
 
748 748
 		/**
749 749
 		 * The Entity service.
750 750
 		 */
751
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-uri-service.php';
752
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-service.php';
751
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-uri-service.php';
752
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-service.php';
753 753
 
754 754
 		// Add the entity rating service.
755
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-rating-service.php';
755
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-rating-service.php';
756 756
 
757 757
 		/**
758 758
 		 * The User service.
759 759
 		 */
760
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-user-service.php';
760
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-user-service.php';
761 761
 
762 762
 		/**
763 763
 		 * The Timeline service.
764 764
 		 */
765
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-timeline-service.php';
765
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-timeline-service.php';
766 766
 
767 767
 		/**
768 768
 		 * The Topic Taxonomy service.
769 769
 		 */
770
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-topic-taxonomy-service.php';
770
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-topic-taxonomy-service.php';
771 771
 
772 772
 		/**
773 773
 		 * The WordLift URI service.
774 774
 		 */
775
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-uri-service.php';
776
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-property-factory.php';
777
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sample-data-service.php';
775
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-uri-service.php';
776
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-property-factory.php';
777
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sample-data-service.php';
778 778
 
779
-		require_once plugin_dir_path( __DIR__ ) . 'includes/properties/class-wordlift-property-getter-factory.php';
780
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-attachment-service.php';
779
+		require_once plugin_dir_path(__DIR__).'includes/properties/class-wordlift-property-getter-factory.php';
780
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-attachment-service.php';
781 781
 
782 782
 		/**
783 783
 		 * Load the converters.
784 784
 		 */
785
-		require_once plugin_dir_path( __DIR__ ) . 'includes/intf-wordlift-post-converter.php';
786
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
787
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
788
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
789
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
790
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-website-jsonld-converter.php';
785
+		require_once plugin_dir_path(__DIR__).'includes/intf-wordlift-post-converter.php';
786
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
787
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-postid-to-jsonld-converter.php';
788
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
789
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-to-jsonld-converter.php';
790
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-website-jsonld-converter.php';
791 791
 
792 792
 		/**
793 793
 		 * Load cache-related files.
794 794
 		 */
795
-		require_once plugin_dir_path( __DIR__ ) . 'includes/cache/require.php';
795
+		require_once plugin_dir_path(__DIR__).'includes/cache/require.php';
796 796
 
797 797
 		/**
798 798
 		 * Load the content filter.
799 799
 		 */
800
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-content-filter-service.php';
800
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-content-filter-service.php';
801 801
 
802 802
 		/*
803 803
 		 * Load the excerpt helper.
804 804
 		 */
805
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-excerpt-helper.php';
805
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-excerpt-helper.php';
806 806
 
807 807
 		/**
808 808
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
809 809
 		 *
810 810
 		 * @since 3.8.0
811 811
 		 */
812
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-jsonld-service.php';
812
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-jsonld-service.php';
813 813
 
814 814
 		// The Publisher Service and the AJAX adapter.
815
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-publisher-service.php';
816
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
815
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-publisher-service.php';
816
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-publisher-ajax-adapter.php';
817 817
 
818
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-adapter.php';
818
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-adapter.php';
819 819
 
820 820
 		/**
821 821
 		 * Load the WordLift key validation service.
822 822
 		 */
823
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-key-validation-service.php';
823
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-key-validation-service.php';
824 824
 
825 825
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
826
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-category-taxonomy-service.php';
826
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-category-taxonomy-service.php';
827 827
 
828 828
 		// Load the `Wordlift_Entity_Page_Service` class definition.
829
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-page-service.php';
829
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-page-service.php';
830 830
 
831 831
 		/** Linked Data. */
832
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-storage.php';
833
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
834
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
835
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
836
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
837
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
838
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
839
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
840
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
841
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
842
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
832
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-storage.php';
833
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
834
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
835
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
836
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
837
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
838
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
839
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
840
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
841
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
842
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-storage-factory.php';
843 843
 
844 844
 		/** Services. */
845
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-google-analytics-export-service.php';
846
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-api-service.php';
845
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-google-analytics-export-service.php';
846
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-api-service.php';
847 847
 
848 848
 		/** Adapters. */
849
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-tinymce-adapter.php';
850
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-newrelic-adapter.php';
851
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
852
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-adapter.php';
853
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-wprocket-adapter.php';
854
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-nitropack-adapter.php';
849
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-tinymce-adapter.php';
850
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-newrelic-adapter.php';
851
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sample-data-ajax-adapter.php';
852
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-adapter.php';
853
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-wprocket-adapter.php';
854
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-nitropack-adapter.php';
855 855
 
856 856
 		/** Autocomplete. */
857
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-autocomplete-adapter.php';
857
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-autocomplete-adapter.php';
858 858
 
859
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-remote-image-service.php';
859
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-remote-image-service.php';
860 860
 
861 861
 		/** Analytics */
862
-		require_once plugin_dir_path( __DIR__ ) . 'includes/analytics/class-wordlift-analytics-connect.php';
862
+		require_once plugin_dir_path(__DIR__).'includes/analytics/class-wordlift-analytics-connect.php';
863 863
 
864 864
 		/**
865 865
 		 * The class responsible for defining all actions that occur in the admin area.
866 866
 		 */
867
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin.php';
867
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin.php';
868 868
 
869 869
 		/**
870 870
 		 * The class to customize the entity list admin page.
871 871
 		 */
872
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-list-service.php';
872
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-list-service.php';
873 873
 
874 874
 		/**
875 875
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
876 876
 		 */
877 877
 		global $wp_version;
878
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
879
-			require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
878
+		if (version_compare($wp_version, '5.3', '<')) {
879
+			require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-types-taxonomy-walker.php';
880 880
 		} else {
881
-			require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
881
+			require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
882 882
 		}
883 883
 
884 884
 		/**
885 885
 		 * The Notice service.
886 886
 		 */
887
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-notice-service.php';
887
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-notice-service.php';
888 888
 
889 889
 		/**
890 890
 		 * The PrimaShop adapter.
891 891
 		 */
892
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-primashop-adapter.php';
892
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-primashop-adapter.php';
893 893
 
894 894
 		/**
895 895
 		 * The WordLift Dashboard service.
896 896
 		 */
897
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-dashboard-service.php';
897
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-dashboard-service.php';
898 898
 
899 899
 		/**
900 900
 		 * The admin 'Install wizard' page.
901 901
 		 */
902
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-setup.php';
902
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-setup.php';
903 903
 
904 904
 		/**
905 905
 		 * The WordLift entity type list admin page controller.
906 906
 		 */
907
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
907
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
908 908
 
909 909
 		/**
910 910
 		 * The WordLift entity type settings admin page controller.
911 911
 		 */
912
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-entity-type-settings.php';
912
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-entity-type-settings.php';
913 913
 
914 914
 		/**
915 915
 		 * The admin 'Download Your Data' page.
916 916
 		 */
917
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-download-your-data-page.php';
917
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-download-your-data-page.php';
918 918
 
919 919
 		/**
920 920
 		 * The admin 'WordLift Settings' page.
921 921
 		 */
922
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/intf-wordlift-admin-element.php';
923
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-input-element.php';
924
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-radio-input-element.php';
925
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-select-element.php';
926
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-select2-element.php';
927
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
928
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
929
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
930
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-author-element.php';
931
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
932
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-page.php';
933
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-page.php';
934
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
935
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
936
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
922
+		require_once plugin_dir_path(__DIR__).'admin/elements/intf-wordlift-admin-element.php';
923
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-input-element.php';
924
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-radio-input-element.php';
925
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-select-element.php';
926
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-select2-element.php';
927
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-language-select-element.php';
928
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-country-select-element.php';
929
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-tabs-element.php';
930
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-author-element.php';
931
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-publisher-element.php';
932
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-page.php';
933
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-page.php';
934
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-analytics-page.php';
935
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-page-action-link.php';
936
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
937 937
 
938 938
 		/** Admin Pages */
939
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-user-profile-page.php';
940
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-type-admin-service.php';
939
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-user-profile-page.php';
940
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-type-admin-service.php';
941 941
 
942 942
 		/**
943 943
 		 * The class responsible for defining all actions that occur in the public-facing
944 944
 		 * side of the site.
945 945
 		 */
946
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-public.php';
946
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-public.php';
947 947
 
948 948
 		/**
949 949
 		 * The shortcode abstract class.
950 950
 		 */
951
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-shortcode.php';
951
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-shortcode.php';
952 952
 
953 953
 		/**
954 954
 		 * The Timeline shortcode.
955 955
 		 */
956
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-timeline-shortcode.php';
956
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-timeline-shortcode.php';
957 957
 
958 958
 		/**
959 959
 		 * The Navigator shortcode.
960 960
 		 */
961
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-navigator-shortcode.php';
961
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-navigator-shortcode.php';
962 962
 
963 963
 		/**
964 964
 		 * The Products Navigator shortcode.
965 965
 		 */
966
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-products-navigator-shortcode.php';
966
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-products-navigator-shortcode.php';
967 967
 
968 968
 		/**
969 969
 		 * The chord shortcode.
970 970
 		 */
971
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-chord-shortcode.php';
971
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-chord-shortcode.php';
972 972
 
973 973
 		/**
974 974
 		 * The geomap shortcode.
975 975
 		 */
976
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-geomap-shortcode.php';
976
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-geomap-shortcode.php';
977 977
 
978 978
 		/**
979 979
 		 * The entity cloud shortcode.
980 980
 		 */
981
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
981
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-related-entities-cloud-shortcode.php';
982 982
 
983 983
 		/**
984 984
 		 * The entity glossary shortcode.
985 985
 		 */
986
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-alphabet-service.php';
987
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-vocabulary-shortcode.php';
986
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-alphabet-service.php';
987
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-vocabulary-shortcode.php';
988 988
 
989 989
 		/**
990 990
 		 * Faceted Search shortcode.
991 991
 		 */
992
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-faceted-search-shortcode.php';
992
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-faceted-search-shortcode.php';
993 993
 
994 994
 		/**
995 995
 		 * The ShareThis service.
996 996
 		 */
997
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-sharethis-service.php';
997
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-sharethis-service.php';
998 998
 
999 999
 		/**
1000 1000
 		 * The SEO service.
1001 1001
 		 */
1002
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-seo-service.php';
1002
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-seo-service.php';
1003 1003
 
1004 1004
 		/**
1005 1005
 		 * The AMP service.
1006 1006
 		 */
1007
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-amp-service.php';
1007
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-amp-service.php';
1008 1008
 
1009 1009
 		/** Widgets */
1010
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-widget.php';
1011
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1012
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-context-cards-service.php';
1010
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-widget.php';
1011
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-related-entities-cloud-widget.php';
1012
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-context-cards-service.php';
1013 1013
 
1014 1014
 		/*
1015 1015
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1018,8 +1018,8 @@  discard block
 block discarded – undo
1018 1018
 		 *
1019 1019
 		 * @since 3.20.0
1020 1020
 		 */
1021
-		require_once plugin_dir_path( __DIR__ ) . 'includes/batch/intf-wordlift-batch-operation.php';
1022
-		require_once plugin_dir_path( __DIR__ ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1021
+		require_once plugin_dir_path(__DIR__).'includes/batch/intf-wordlift-batch-operation.php';
1022
+		require_once plugin_dir_path(__DIR__).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1023 1023
 
1024 1024
 		/*
1025 1025
 		 * Schema.org Services.
@@ -1027,10 +1027,10 @@  discard block
 block discarded – undo
1027 1027
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1028 1028
 		 */
1029 1029
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1030
-		if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
1031
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1032
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1033
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1030
+		if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
1031
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1032
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1033
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1034 1034
 			new Wordlift_Schemaorg_Sync_Service();
1035 1035
 			$schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance();
1036 1036
 			new Wordlift_Schemaorg_Class_Service();
@@ -1046,13 +1046,13 @@  discard block
 block discarded – undo
1046 1046
 
1047 1047
 		// Instantiate a global logger.
1048 1048
 		global $wl_logger;
1049
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1049
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1050 1050
 
1051 1051
 		// Load the `wl-api` end-point.
1052 1052
 		new Wordlift_Http_Api();
1053 1053
 
1054 1054
 		// Load the Install Service.
1055
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-service.php';
1055
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-service.php';
1056 1056
 		$this->install_service = new Wordlift_Install_Service();
1057 1057
 		$this->notice_service  = new Wordlift_Notice_Service();
1058 1058
 		$this->user_service    = Wordlift_User_Service::get_instance();
@@ -1074,21 +1074,21 @@  discard block
 block discarded – undo
1074 1074
 		add_action(
1075 1075
 			'plugins_loaded',
1076 1076
 			// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
1077
-			function () use ( &$that, $schemaorg_property_service ) {
1077
+			function() use (&$that, $schemaorg_property_service) {
1078 1078
 
1079 1079
 				/** Services. */
1080 1080
 				// Create the configuration service.
1081 1081
 				new Wordlift_Api_Service();
1082 1082
 
1083 1083
 				// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1084
-				$that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() );
1084
+				$that->entity_link_service = new Wordlift_Entity_Link_Service($that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path());
1085 1085
 
1086 1086
 				$schema_url_property_service = new Wordlift_Schema_Url_Property_Service();
1087 1087
 
1088 1088
 				$that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance();
1089 1089
 
1090 1090
 				// Create a new instance of the Redirect service.
1091
-				$that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service );
1091
+				$that->redirect_service = new Wordlift_Redirect_Service($that->entity_uri_service);
1092 1092
 
1093 1093
 				// Create a new instance of the Timeline service and Timeline shortcode.
1094 1094
 				$that->timeline_service = new Wordlift_Timeline_Service();
@@ -1101,30 +1101,30 @@  discard block
 block discarded – undo
1101 1101
 				// Create an instance of the PrimaShop adapter.
1102 1102
 				$that->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1103 1103
 
1104
-				$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1104
+				$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1105 1105
 
1106 1106
 				// Create the entity rating service.
1107 1107
 				$that->rating_service = Wordlift_Rating_Service::get_instance();
1108 1108
 
1109 1109
 				// Create entity list customization (wp-admin/edit.php).
1110
-				$that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service );
1110
+				$that->entity_list_service = new Wordlift_Entity_List_Service($that->rating_service);
1111 1111
 
1112 1112
 				// Create an instance of the Publisher Service and the AJAX Adapter.
1113 1113
 				$that->publisher_service = Wordlift_Publisher_Service::get_instance();
1114
-				$that->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1115
-				$that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1114
+				$that->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1115
+				$that->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1116 1116
 
1117 1117
 				$attachment_service = Wordlift_Attachment_Service::get_instance();
1118 1118
 
1119 1119
 				// Instantiate the JSON-LD service.
1120 1120
 				$property_getter                       = Wordlift_Property_Getter_Factory::create();
1121
-				$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1122
-				$that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter );
1123
-				$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter );
1124
-				$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1121
+				$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1122
+				$that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter);
1123
+				$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter($that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter);
1124
+				$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1125 1125
 
1126
-				$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1127
-				$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache );
1126
+				$jsonld_cache                            = new Ttl_Cache('jsonld', 86400);
1127
+				$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($that->postid_to_jsonld_converter, $jsonld_cache);
1128 1128
 				/*
1129 1129
 				* Load the `Wordlift_Term_JsonLd_Adapter`.
1130 1130
 				*
@@ -1132,22 +1132,22 @@  discard block
 block discarded – undo
1132 1132
 				*
1133 1133
 				* @since 3.20.0
1134 1134
 				*/
1135
-				require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-term-jsonld-adapter.php';
1135
+				require_once plugin_dir_path(__DIR__).'public/class-wordlift-term-jsonld-adapter.php';
1136 1136
 
1137
-				$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter );
1138
-				$that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter );
1137
+				$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter($that->entity_uri_service, $that->cached_postid_to_jsonld_converter);
1138
+				$that->jsonld_service = new Wordlift_Jsonld_Service(Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter);
1139 1139
 
1140 1140
 				$jsonld_service = new Jsonld_Service(
1141 1141
 					$that->jsonld_service,
1142 1142
 					$term_jsonld_adapter,
1143
-					new Jsonld_User_Service( $that->user_service )
1143
+					new Jsonld_User_Service($that->user_service)
1144 1144
 				);
1145
-				new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service );
1145
+				new Jsonld_Endpoint($jsonld_service, $that->entity_uri_service);
1146 1146
 
1147 1147
 				// Prints the JSON-LD in the head.
1148
-				new Jsonld_Adapter( $that->jsonld_service );
1148
+				new Jsonld_Adapter($that->jsonld_service);
1149 1149
 
1150
-				new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service );
1150
+				new Jsonld_By_Id_Endpoint($that->jsonld_service, $that->entity_uri_service);
1151 1151
 
1152 1152
 				/**
1153 1153
 				 * @since 3.37.1
@@ -1161,10 +1161,10 @@  discard block
 block discarded – undo
1161 1161
 				// Creating Faq Content filter service.
1162 1162
 				$that->faq_content_filter_service = new Faq_Content_Filter();
1163 1163
 				$that->sample_data_service        = Wordlift_Sample_Data_Service::get_instance();
1164
-				$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service );
1164
+				$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter($that->sample_data_service);
1165 1165
 
1166
-				$that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' );
1167
-				$that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' );
1166
+				$that->loader->add_action('enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks');
1167
+				$that->loader->add_action('admin_enqueue_scripts', $that, 'add_wl_enabled_blocks');
1168 1168
 
1169 1169
 				/**
1170 1170
 				 * Filter: wl_feature__enable__blocks.
@@ -1174,15 +1174,15 @@  discard block
 block discarded – undo
1174 1174
 				 * @return bool
1175 1175
 				 * @since 3.27.6
1176 1176
 				 */
1177
-				if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1177
+				if (apply_filters('wl_feature__enable__blocks', true)) {
1178 1178
 					// Initialize the short-codes.
1179
-					new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1179
+					new Async_Template_Decorator(new Wordlift_Navigator_Shortcode());
1180 1180
 					new Wordlift_Chord_Shortcode();
1181 1181
 					new Wordlift_Geomap_Shortcode();
1182 1182
 					new Wordlift_Timeline_Shortcode();
1183
-					new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() );
1183
+					new Wordlift_Related_Entities_Cloud_Shortcode(Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance());
1184 1184
 					new Wordlift_Vocabulary_Shortcode();
1185
-					new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1185
+					new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode());
1186 1186
 				}
1187 1187
 
1188 1188
 				new Wordlift_Products_Navigator_Shortcode();
@@ -1194,16 +1194,16 @@  discard block
 block discarded – undo
1194 1194
 				new Wordlift_Seo_Service();
1195 1195
 
1196 1196
 				// Initialize the AMP service.
1197
-				new Wordlift_AMP_Service( $that->jsonld_service );
1197
+				new Wordlift_AMP_Service($that->jsonld_service);
1198 1198
 
1199 1199
 				/** Services. */
1200 1200
 				$that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1201 1201
 				new Wordlift_Image_Service();
1202 1202
 
1203 1203
 				/** Adapters. */
1204
-				$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() );
1205
-				$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service );
1206
-				$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $that );
1204
+				$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter(Wordlift_Entity_Type_Service::get_instance());
1205
+				$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($that->publisher_service);
1206
+				$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter($that);
1207 1207
 
1208 1208
 				/*
1209 1209
 				* Exclude our public js from WP-Rocket.
@@ -1227,14 +1227,14 @@  discard block
 block discarded – undo
1227 1227
 				$that->language_select_element = new Wordlift_Admin_Language_Select_Element();
1228 1228
 				$that->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1229 1229
 				$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1230
-				$that->publisher_element       = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element );
1231
-				$that->author_element          = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element );
1230
+				$that->publisher_element       = new Wordlift_Admin_Publisher_Element($that->publisher_service, $tabs_element, $that->select2_element);
1231
+				$that->author_element          = new Wordlift_Admin_Author_Element($that->publisher_service, $that->select2_element);
1232 1232
 
1233 1233
 				$that->settings_page             = Wordlift_Admin_Settings_Page::get_instance();
1234
-				$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page );
1234
+				$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($that->settings_page);
1235 1235
 
1236
-				$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element );
1237
-				$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page );
1236
+				$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($that->input_element, $that->radio_input_element);
1237
+				$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($that->analytics_settings_page);
1238 1238
 				$that->analytics_connect                   = new Wordlift_Analytics_Connect();
1239 1239
 
1240 1240
 				// Pages.
@@ -1245,9 +1245,9 @@  discard block
 block discarded – undo
1245 1245
 				*
1246 1246
 				* @see https://github.com/insideout10/wordlift-plugin/issues/914
1247 1247
 				*/
1248
-				if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1249
-					require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-post-edit-page.php';
1250
-					new Wordlift_Admin_Post_Edit_Page( $that );
1248
+				if (apply_filters('wl_can_see_classification_box', true)) {
1249
+					require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-post-edit-page.php';
1250
+					new Wordlift_Admin_Post_Edit_Page($that);
1251 1251
 				}
1252 1252
 				new Wordlift_Entity_Type_Admin_Service();
1253 1253
 
@@ -1255,19 +1255,19 @@  discard block
 block discarded – undo
1255 1255
 				$that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1256 1256
 
1257 1257
 				// Create an instance of the install wizard.
1258
-				$that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element );
1258
+				$that->admin_setup = new Wordlift_Admin_Setup($that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element);
1259 1259
 
1260
-				$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service );
1260
+				$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($that->entity_post_type_service);
1261 1261
 
1262 1262
 				// User Profile.
1263
-				new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service );
1263
+				new Wordlift_Admin_User_Profile_Page($that->author_element, $that->user_service);
1264 1264
 
1265 1265
 				$that->entity_page_service = new Wordlift_Entity_Page_Service();
1266 1266
 
1267 1267
 				// Load the debug service if WP is in debug mode.
1268
-				if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1269
-					require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-debug-service.php';
1270
-					new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service );
1268
+				if (defined('WP_DEBUG') && WP_DEBUG) {
1269
+					require_once plugin_dir_path(__DIR__).'includes/class-wordlift-debug-service.php';
1270
+					new Wordlift_Debug_Service(Wordlift_Entity_Service::get_instance(), $uri_service);
1271 1271
 				}
1272 1272
 
1273 1273
 				// Remote Image Service.
@@ -1280,12 +1280,12 @@  discard block
 block discarded – undo
1280 1280
 				*
1281 1281
 				* @see https://github.com/insideout10/wordlift-plugin/issues/852.
1282 1282
 				*/
1283
-				require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-batch-action.php';
1284
-				require_once plugin_dir_path( __DIR__ ) . 'includes/mapping/class-wordlift-mapping-service.php';
1285
-				require_once plugin_dir_path( __DIR__ ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1283
+				require_once plugin_dir_path(__DIR__).'includes/class-wordlift-batch-action.php';
1284
+				require_once plugin_dir_path(__DIR__).'includes/mapping/class-wordlift-mapping-service.php';
1285
+				require_once plugin_dir_path(__DIR__).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1286 1286
 
1287 1287
 				// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1288
-				new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1288
+				new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1289 1289
 
1290 1290
 				/*
1291 1291
 				* Load the Mappings JSON-LD post processing.
@@ -1299,11 +1299,11 @@  discard block
 block discarded – undo
1299 1299
 				// Taxonomy term rule validator for validating rules for term pages.
1300 1300
 				new Taxonomy_Term_Rule_Validator();
1301 1301
 				new Post_Taxonomy_Term_Rule_Validator();
1302
-				$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1303
-				$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1304
-				$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1302
+				$rule_validators_registry = new Rule_Validators_Registry($default_rule_validator);
1303
+				$rule_groups_validator    = new Rule_Groups_Validator($rule_validators_registry);
1304
+				$mappings_validator       = new Mappings_Validator($mappings_dbo, $rule_groups_validator);
1305 1305
 
1306
-				new Url_To_Entity_Transform_Function( $that->entity_uri_service );
1306
+				new Url_To_Entity_Transform_Function($that->entity_uri_service);
1307 1307
 				new Taxonomy_To_Terms_Transform_Function();
1308 1308
 				new Post_Id_To_Entity_Transform_Function();
1309 1309
 				$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
@@ -1313,7 +1313,7 @@  discard block
 block discarded – undo
1313 1313
 				 * Intiailize the acf group data formatter.
1314 1314
 				 */
1315 1315
 				new Acf_Group_Formatter();
1316
-				new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1316
+				new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry);
1317 1317
 
1318 1318
 				/**
1319 1319
 				 * @since 3.26.0
@@ -1331,16 +1331,16 @@  discard block
 block discarded – undo
1331 1331
 				// Call this static method to register FAQ routes to rest api - disabled
1332 1332
 				// Faq_Rest_Controller::register_routes();
1333 1333
 
1334
-				$that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter );
1334
+				$that->storage_factory = new Wordlift_Storage_Factory(Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter);
1335 1335
 
1336 1336
 				/** WL Autocomplete. */
1337
-				$autocomplete_service       = new All_Autocomplete_Service(
1337
+				$autocomplete_service = new All_Autocomplete_Service(
1338 1338
 					array(
1339 1339
 						new Local_Autocomplete_Service(),
1340
-						new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ),
1340
+						new Linked_Data_Autocomplete_Service(Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance()),
1341 1341
 					)
1342 1342
 				);
1343
-				$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1343
+				$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service);
1344 1344
 
1345 1345
 				/**
1346 1346
 				 * @since 3.27.2
@@ -1349,10 +1349,10 @@  discard block
 block discarded – undo
1349 1349
 				 */
1350 1350
 				new Recipe_Maker_Post_Type_Hook();
1351 1351
 				$recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1352
-				new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1353
-				new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1354
-				new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service );
1355
-				new Recipe_Maker_Warning( $recipe_maker_validation_service );
1352
+				new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service);
1353
+				new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service);
1354
+				new Recipe_Maker_Jsonld_Swap($recipe_maker_validation_service, $that->jsonld_service);
1355
+				new Recipe_Maker_Warning($recipe_maker_validation_service);
1356 1356
 
1357 1357
 				/**
1358 1358
 				 * Avada Builder compatibility.
@@ -1367,10 +1367,10 @@  discard block
 block discarded – undo
1367 1367
 				 * @since 3.27.8
1368 1368
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1369 1369
 				 */
1370
-				new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() );
1370
+				new Key_Validation_Notice($that->key_validation_service, Wordlift_Configuration_Service::get_instance());
1371 1371
 
1372 1372
 				// Only show the notice when the key is set
1373
-				if ( \Wordlift_Configuration_Service::get_instance()->get_key() && ! \Wordlift_Configuration_Service::get_instance()->get_skip_installation_notice() ) {
1373
+				if (\Wordlift_Configuration_Service::get_instance()->get_key() && ! \Wordlift_Configuration_Service::get_instance()->get_skip_installation_notice()) {
1374 1374
 					$installation_complete_notice = new Installation_Complete_Notice();
1375 1375
 					$installation_complete_notice->init();
1376 1376
 				}
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 				 * @since 3.29.0
1386 1386
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1387 1387
 				 */
1388
-				new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() );
1388
+				new Entity_Rest_Service(Wordlift_Entity_Type_Service::get_instance());
1389 1389
 
1390 1390
 				/**
1391 1391
 				 * Expand author in to references.
@@ -1394,12 +1394,12 @@  discard block
 block discarded – undo
1394 1394
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1318
1395 1395
 				 */
1396 1396
 				// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1397
-				if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1398
-					new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1397
+				if (apply_filters('wl_feature__enable__article-wrapper', false)) {
1398
+					new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter);
1399 1399
 				}
1400 1400
 
1401 1401
 				// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1402
-				if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1402
+				if (apply_filters('wl_feature__enable__match-terms', false)) {
1403 1403
 					$vocabulary_loader = new Vocabulary_Loader();
1404 1404
 					$vocabulary_loader->init_vocabulary();
1405 1405
 				}
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 				/**
1408 1408
 				 * Added for feature request 1496 (Webhooks)
1409 1409
 				 */
1410
-				if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1410
+				if (apply_filters('wl_feature__enable__webhooks', false)) {
1411 1411
 					$that->webhook_loader = new Webhooks_Loader();
1412 1412
 					$that->webhook_loader->init();
1413 1413
 				}
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 				 * @since 3.31.5
1437 1437
 				 * Create configuration endpoint for webapp to configure.
1438 1438
 				 */
1439
-				new Config( $that->admin_setup, $that->key_validation_service );
1439
+				new Config($that->admin_setup, $that->key_validation_service);
1440 1440
 				/**
1441 1441
 				 * @since 3.31.7
1442 1442
 				 * Remove duplicate videoobject.
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 				 * @since 3.32.0
1449 1449
 				 * Create loader for vocabulary terms.
1450 1450
 				 */
1451
-				$vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter );
1451
+				$vocabulary_terms_loader = new Vocabulary_Terms_Loader(Wordlift_Entity_Type_Service::get_instance(), $property_getter);
1452 1452
 				$vocabulary_terms_loader->init_feature();
1453 1453
 
1454 1454
 				new Entity_Type_Change_Handler(
@@ -1477,9 +1477,9 @@  discard block
 block discarded – undo
1477 1477
 	private function set_locale() {
1478 1478
 
1479 1479
 		$plugin_i18n = new Wordlift_I18n();
1480
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1480
+		$plugin_i18n->set_domain($this->get_plugin_name());
1481 1481
 
1482
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1482
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1483 1483
 
1484 1484
 	}
1485 1485
 
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
 	 * @since    1.0.0
1491 1491
 	 * @access   private
1492 1492
 	 */
1493
-	private function define_admin_hooks( $that ) {
1493
+	private function define_admin_hooks($that) {
1494 1494
 		$plugin_admin = new Wordlift_Admin(
1495 1495
 			$that->get_plugin_name(),
1496 1496
 			$that->get_version(),
@@ -1498,51 +1498,51 @@  discard block
 block discarded – undo
1498 1498
 			$that->user_service
1499 1499
 		);
1500 1500
 
1501
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1502
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1501
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1502
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1503 1503
 
1504 1504
 		// Hook the `admin_init` function to the Admin Setup.
1505
-		Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' );
1506
-		$that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' );
1505
+		Assertions::is_set($that->admin_setup, '`admin_setup` must be set');
1506
+		$that->loader->add_action('admin_init', $that->admin_setup, 'admin_init');
1507 1507
 
1508 1508
 		// Hook the admin_init to the settings page.
1509
-		Assertions::is_set( $that->settings_page, '`setting_page` must be set' );
1510
-		$that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' );
1509
+		Assertions::is_set($that->settings_page, '`setting_page` must be set');
1510
+		$that->loader->add_action('admin_init', $that->settings_page, 'admin_init');
1511 1511
 
1512 1512
 		// Hook the admin_init to the analytics settings page.
1513
-		Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' );
1514
-		$that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' );
1513
+		Assertions::is_set($that->analytics_settings_page, '`analytics_setting_page` must be set');
1514
+		$that->loader->add_action('admin_init', $that->analytics_settings_page, 'admin_init');
1515 1515
 
1516 1516
 		// Hook the init action to taxonomy services.
1517
-		$that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 );
1518
-		$that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 );
1517
+		$that->loader->add_action('init', $that->topic_taxonomy_service, 'init', 0);
1518
+		$that->loader->add_action('init', $that->entity_types_taxonomy_service, 'init', 0);
1519 1519
 
1520 1520
 		// Hook the AJAX wl_timeline action to the Timeline service.
1521
-		$that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1521
+		$that->loader->add_action('wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline');
1522 1522
 
1523 1523
 		// Register custom allowed redirect hosts.
1524
-		$that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' );
1524
+		$that->loader->add_filter('allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts');
1525 1525
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1526
-		$that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' );
1526
+		$that->loader->add_action('wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect');
1527 1527
 
1528 1528
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1529 1529
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1530
-		$that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 2 );
1531
-		$that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 );
1530
+		$that->loader->add_action('save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 2);
1531
+		$that->loader->add_action('save_post', $that->rating_service, 'set_rating_for', 20, 1);
1532 1532
 
1533
-		$that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 );
1534
-		$that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' );
1533
+		$that->loader->add_action('edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1);
1534
+		$that->loader->add_action('in_admin_header', $that->rating_service, 'in_admin_header');
1535 1535
 
1536 1536
 		// Entity listing customization (wp-admin/edit.php)
1537 1537
 		// Add custom columns.
1538
-		$that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' );
1538
+		$that->loader->add_filter('manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns');
1539 1539
 		// no explicit entity as it prevents handling of other post types.
1540
-		$that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 );
1540
+		$that->loader->add_filter('manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2);
1541 1541
 		// Add 4W selection.
1542
-		$that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' );
1543
-		$that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' );
1544
-		$that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' );
1545
-		$that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' );
1542
+		$that->loader->add_action('restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope');
1543
+		$that->loader->add_filter('posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope');
1544
+		$that->loader->add_action('pre_get_posts', $that->entity_list_service, 'pre_get_posts');
1545
+		$that->loader->add_action('load-edit.php', $that->entity_list_service, 'load_edit');
1546 1546
 
1547 1547
 		/*
1548 1548
 		 * If `All Entity Types` is disable, use the radio button Walker.
@@ -1550,18 +1550,18 @@  discard block
 block discarded – undo
1550 1550
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1551 1551
 		 */
1552 1552
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1553
-		if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES )
1553
+		if ( ! apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)
1554 1554
 		     // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1555
-			 && ! apply_filters( 'wl_feature__enable__entity-types-professional', false )
1555
+			 && ! apply_filters('wl_feature__enable__entity-types-professional', false)
1556 1556
 		     // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1557
-			 && ! apply_filters( 'wl_feature__enable__entity-types-business', false )
1557
+			 && ! apply_filters('wl_feature__enable__entity-types-business', false)
1558 1558
 		) {
1559
-			$that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' );
1559
+			$that->loader->add_filter('wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args');
1560 1560
 		}
1561 1561
 
1562 1562
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1563 1563
 		// entities.
1564
-		$that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10 );
1564
+		$that->loader->add_filter('prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10);
1565 1565
 
1566 1566
 		/**
1567 1567
 		 * Filter: wl_feature__enable__settings-download.
@@ -1581,20 +1581,20 @@  discard block
 block discarded – undo
1581 1581
 		);
1582 1582
 
1583 1583
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1584
-		$that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 );
1584
+		$that->loader->add_action('wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10);
1585 1585
 
1586 1586
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1587
-		$that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' );
1588
-		$that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' );
1589
-		$that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1587
+		$that->loader->add_action('wp_ajax_wl_jsonld', $that->jsonld_service, 'get');
1588
+		$that->loader->add_action('admin_post_wl_jsonld', $that->jsonld_service, 'get');
1589
+		$that->loader->add_action('admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1590 1590
 
1591 1591
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1592
-		$that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' );
1592
+		$that->loader->add_action('wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key');
1593 1593
 
1594 1594
 		// Hook the AJAX wl_update_country_options action to the countries.
1595
-		$that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' );
1595
+		$that->loader->add_action('wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html');
1596 1596
 
1597
-		$that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' );
1597
+		$that->loader->add_filter('admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction');
1598 1598
 
1599 1599
 		// Hook the menu creation on the general wordlift menu creation.
1600 1600
 		/**
@@ -1608,16 +1608,16 @@  discard block
 block discarded – undo
1608 1608
 		 * Since 3.30.0 this feature is registered using registry.
1609 1609
 		 */
1610 1610
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1611
-		if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1612
-			add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1611
+		if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) {
1612
+			add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2);
1613 1613
 		}
1614 1614
 
1615 1615
 		// Hook key update.
1616
-		$that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 );
1617
-		$that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 );
1616
+		$that->loader->add_action('pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2);
1617
+		$that->loader->add_action('update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2);
1618 1618
 
1619 1619
 		// Add additional action links to the WordLift plugin in the plugins page.
1620
-		$that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 );
1620
+		$that->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1);
1621 1621
 
1622 1622
 		/*
1623 1623
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1628,23 +1628,23 @@  discard block
 block discarded – undo
1628 1628
 		// $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 );
1629 1629
 
1630 1630
 		// Hook the AJAX `wl_publisher` action name.
1631
-		$that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' );
1631
+		$that->loader->add_action('wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher');
1632 1632
 
1633 1633
 		// Hook row actions for the entity type list admin.
1634
-		$that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1634
+		$that->loader->add_filter('wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1635 1635
 
1636 1636
 		/** Ajax actions. */
1637
-		$that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' );
1637
+		$that->loader->add_action('wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export');
1638 1638
 
1639 1639
 		// Hook capabilities manipulation to allow access to entity type admin
1640 1640
 		// page  on WordPress versions before 4.7.
1641 1641
 		global $wp_version;
1642
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1643
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 2 );
1642
+		if (version_compare($wp_version, '4.7', '<')) {
1643
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 2);
1644 1644
 		}
1645 1645
 
1646 1646
 		/** Adapters. */
1647
-		$that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1647
+		$that->loader->add_filter('mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1);
1648 1648
 		/**
1649 1649
 		 * Disabling Faq temporarily.
1650 1650
 		 * Load the tinymce editor button on the tool bar.
@@ -1655,14 +1655,14 @@  discard block
 block discarded – undo
1655 1655
 		// $that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1656 1656
 		// $that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1657 1657
 
1658
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' );
1659
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' );
1658
+		$that->loader->add_action('wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create');
1659
+		$that->loader->add_action('wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete');
1660 1660
 
1661 1661
 		/**
1662 1662
 		 * @since 3.26.0
1663 1663
 		 */
1664 1664
 		$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1665
-		$that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1665
+		$that->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box');
1666 1666
 		// Adding Rest route for the post excerpt
1667 1667
 		Post_Excerpt_Rest_Controller::register_routes();
1668 1668
 
@@ -1683,14 +1683,14 @@  discard block
 block discarded – undo
1683 1683
 		);
1684 1684
 
1685 1685
 		// Hooks to restrict multisite super admin from manipulating entity types.
1686
-		if ( is_multisite() ) {
1687
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 2 );
1686
+		if (is_multisite()) {
1687
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 2);
1688 1688
 		}
1689 1689
 
1690 1690
 		$deactivator_feedback = new Wordlift_Deactivator_Feedback();
1691 1691
 
1692
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1693
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1692
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1693
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1694 1694
 		add_action(
1695 1695
 			'wp_ajax_wl_deactivation_feedback',
1696 1696
 			array(
@@ -1706,13 +1706,13 @@  discard block
 block discarded – undo
1706 1706
 		 */
1707 1707
 		add_filter(
1708 1708
 			'allowed_block_types',
1709
-			function ( $value ) {
1709
+			function($value) {
1710 1710
 
1711
-				if ( true === $value ) {
1711
+				if (true === $value) {
1712 1712
 					return $value;
1713 1713
 				}
1714 1714
 
1715
-				return array_merge( (array) $value, array( 'wordlift/classification' ) );
1715
+				return array_merge((array) $value, array('wordlift/classification'));
1716 1716
 			},
1717 1717
 			PHP_INT_MAX
1718 1718
 		);
@@ -1725,14 +1725,14 @@  discard block
 block discarded – undo
1725 1725
 
1726 1726
 		add_action(
1727 1727
 			'admin_notices',
1728
-			function () {
1729
-				if ( apply_filters( 'wl_feature__enable__notices', true ) ) {
1728
+			function() {
1729
+				if (apply_filters('wl_feature__enable__notices', true)) {
1730 1730
 					/**
1731 1731
 					 * Fired when the notice feature is enabled.
1732 1732
 					 *
1733 1733
 					 * @since 3.40.4
1734 1734
 					 */
1735
-					do_action( 'wordlift_admin_notices' );
1735
+					do_action('wordlift_admin_notices');
1736 1736
 				}
1737 1737
 			}
1738 1738
 		);
@@ -1746,57 +1746,57 @@  discard block
 block discarded – undo
1746 1746
 	 * @since    1.0.0
1747 1747
 	 * @access   private
1748 1748
 	 */
1749
-	private function define_public_hooks( $that ) {
1749
+	private function define_public_hooks($that) {
1750 1750
 
1751
-		$plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() );
1751
+		$plugin_public = new Wordlift_Public($that->get_plugin_name(), $that->get_version());
1752 1752
 
1753 1753
 		// Register the entity post type.
1754
-		$that->loader->add_action( 'init', $that->entity_post_type_service, 'register' );
1754
+		$that->loader->add_action('init', $that->entity_post_type_service, 'register');
1755 1755
 
1756 1756
 		// Bind the link generation and handling hooks to the entity link service.
1757
-		$that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 2 );
1758
-		$that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1757
+		$that->loader->add_filter('post_type_link', $that->entity_link_service, 'post_type_link', 10, 2);
1758
+		$that->loader->add_action('pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1759 1759
 
1760
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1761
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1762
-		$that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' );
1760
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1761
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1762
+		$that->loader->add_action('wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts');
1763 1763
 
1764 1764
 		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1765
-		$that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1765
+		$that->loader->add_filter('the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags');
1766 1766
 		// Hook the content filter service to add entity links.
1767
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1767
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1768 1768
 			// We run before other filters.
1769
-			$that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 );
1769
+			$that->loader->add_filter('the_content', $that->content_filter_service, 'the_content', 9);
1770 1770
 		}
1771 1771
 
1772 1772
 		// Hook the AJAX wl_timeline action to the Timeline service.
1773
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1773
+		$that->loader->add_action('wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline');
1774 1774
 
1775 1775
 		// Hook the ShareThis service.
1776
-		$that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 );
1777
-		$that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 );
1776
+		$that->loader->add_filter('the_content', $that->sharethis_service, 'the_content', 99);
1777
+		$that->loader->add_filter('the_excerpt', $that->sharethis_service, 'the_excerpt', 99);
1778 1778
 
1779 1779
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1780
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1780
+		$that->loader->add_action('wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1781 1781
 
1782 1782
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1783 1783
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1784 1784
 		// to categories.
1785
-		$that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1785
+		$that->loader->add_action('pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1);
1786 1786
 
1787 1787
 		/*
1788 1788
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1789 1789
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1790 1790
 		 * order of start time.
1791 1791
 		 */
1792
-		$that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 );
1792
+		$that->loader->add_action('pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1);
1793 1793
 
1794 1794
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1795
-		$that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 2 );
1795
+		$that->loader->add_action('save_post', $that->entity_type_adapter, 'save_post', 9, 2);
1796 1796
 
1797 1797
 		// Analytics Script Frontend.
1798
-		if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) {
1799
-			$that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 );
1798
+		if (apply_filters('wl_feature__enable__analytics', true) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable()) {
1799
+			$that->loader->add_action('wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10);
1800 1800
 		}
1801 1801
 
1802 1802
 	}
@@ -1861,7 +1861,7 @@  discard block
 block discarded – undo
1861 1861
 		 * @since 3.27.6
1862 1862
 		 */
1863 1863
 		// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter,WordPress.WP.EnqueuedResourceParameters.MissingVersion
1864
-		wp_register_script( 'wl_enabled_blocks', false );
1864
+		wp_register_script('wl_enabled_blocks', false);
1865 1865
 
1866 1866
 		$enabled_blocks = array();
1867 1867
 
@@ -1871,11 +1871,11 @@  discard block
 block discarded – undo
1871 1871
 		 * @since 3.32.3
1872 1872
 		 */
1873 1873
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1874
-		if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
1874
+		if (apply_filters('wl_feature__enable__product-navigator', true)) {
1875 1875
 			$enabled_blocks[] = 'wordlift/products-navigator';
1876 1876
 		}
1877 1877
 
1878
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1878
+		if (apply_filters('wl_feature__enable__blocks', true)) {
1879 1879
 			// To intimate JS
1880 1880
 			$enabled_blocks = array_merge(
1881 1881
 				$enabled_blocks,
@@ -1891,8 +1891,8 @@  discard block
 block discarded – undo
1891 1891
 			);
1892 1892
 		}
1893 1893
 
1894
-		wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
1895
-		wp_enqueue_script( 'wl_enabled_blocks' );
1894
+		wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks);
1895
+		wp_enqueue_script('wl_enabled_blocks');
1896 1896
 	}
1897 1897
 
1898 1898
 	/**
@@ -1901,13 +1901,13 @@  discard block
 block discarded – undo
1901 1901
 	public function register_screens() {
1902 1902
 		// Hook the menu to the Download Your Data page.
1903 1903
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1904
-		if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
1905
-			Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" );
1906
-			add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
1904
+		if (apply_filters('wl_feature__enable__settings-download', true)) {
1905
+			Assertions::is_set($this->download_your_data_page, "`download_your_data_page` can't be null");
1906
+			add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0);
1907 1907
 		}
1908 1908
 
1909
-		Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" );
1910
-		add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
1909
+		Assertions::is_set($this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null");
1910
+		add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0);
1911 1911
 
1912 1912
 	}
1913 1913
 
Please login to merge, or discard this patch.
src/wordlift/vocabulary/jsonld/class-term-jsonld.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
 class Term_Jsonld {
12 12
 
13 13
 	public function init() {
14
-		add_filter( 'wl_term_jsonld_array', array( $this, 'wl_term_jsonld_array' ), 10, 2 );
14
+		add_filter('wl_term_jsonld_array', array($this, 'wl_term_jsonld_array'), 10, 2);
15 15
 	}
16 16
 
17
-	public function wl_term_jsonld_array( $jsonld_array, $term_id ) {
17
+	public function wl_term_jsonld_array($jsonld_array, $term_id) {
18 18
 
19
-		$entities = Jsonld_Utils::get_matched_entities_for_term( $term_id );
19
+		$entities = Jsonld_Utils::get_matched_entities_for_term($term_id);
20 20
 
21
-		if ( count( $entities ) > 0 ) {
22
-			$entity             = array_shift( $entities );
21
+		if (count($entities) > 0) {
22
+			$entity             = array_shift($entities);
23 23
 			$entity['@context'] = 'http://schema.org';
24 24
 
25
-			$term_link = get_term_link( $term_id );
26
-			if ( is_wp_error( $term_link ) ) {
27
-				Wordlift_Log_Service::get_logger( get_class() )
28
-					->error( "Term $term_id returned an error: " . $term_link->get_error_message() );
25
+			$term_link = get_term_link($term_id);
26
+			if (is_wp_error($term_link)) {
27
+				Wordlift_Log_Service::get_logger(get_class())
28
+					->error("Term $term_id returned an error: ".$term_link->get_error_message());
29 29
 
30 30
 				return $jsonld_array;
31 31
 			}
32 32
 
33
-			$entity['@id']              = $term_link . '/#id';
33
+			$entity['@id']              = $term_link.'/#id';
34 34
 			$entity['url']              = $term_link;
35 35
 			$entity['mainEntityOfPage'] = $term_link;
36 36
 			$jsonld_array['jsonld'][]   = $entity;
Please login to merge, or discard this patch.
src/wordlift.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -32,28 +32,28 @@  discard block
 block discarded – undo
32 32
 use Wordlift\Post\Post_Adapter;
33 33
 
34 34
 // If this file is called directly, abort.
35
-if ( ! defined( 'WPINC' ) ) {
35
+if ( ! defined('WPINC')) {
36 36
 	die;
37 37
 }
38 38
 define(
39 39
 	'WORDLIFT_PLUGIN_FILE',
40 40
 	__FILE__
41 41
 );
42
-define( 'WORDLIFT_VERSION', '3.41.0-dev' );
42
+define('WORDLIFT_VERSION', '3.41.0-dev');
43 43
 
44
-require_once __DIR__ . '/modules/common/load.php';
45
-require_once __DIR__ . '/modules/include-exclude/load.php';
44
+require_once __DIR__.'/modules/common/load.php';
45
+require_once __DIR__.'/modules/include-exclude/load.php';
46 46
 
47 47
 /**
48 48
  * Filter to disable WLP on any request, defaults to true.
49 49
  *
50 50
  * @since 3.33.6
51 51
  */
52
-if ( ! apply_filters( 'wl_is_enabled', true ) ) {
52
+if ( ! apply_filters('wl_is_enabled', true)) {
53 53
 	return;
54 54
 }
55 55
 
56
-require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
56
+require_once plugin_dir_path(__FILE__).'vendor/autoload.php';
57 57
 
58 58
 /*
59 59
 	 * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http.
@@ -63,15 +63,15 @@  discard block
 block discarded – undo
63 63
 wordlift_plugin_autoload_register();
64 64
 
65 65
 // Include WordLift constants.
66
-require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php';
66
+require_once plugin_dir_path(__FILE__).'wordlift-constants.php';
67 67
 
68 68
 // Load modules.
69
-require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php';
69
+require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php';
70 70
 
71
-require_once plugin_dir_path( __FILE__ ) . 'deprecations.php';
71
+require_once plugin_dir_path(__FILE__).'deprecations.php';
72 72
 
73 73
 // Load early to enable/disable features.
74
-require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php';
74
+require_once plugin_dir_path(__FILE__).'wordlift/features/index.php';
75 75
 
76 76
 /**
77 77
  * The code that runs during plugin activation.
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
  */
80 80
 function activate_wordlift() {
81 81
 
82
-	$log = Wordlift_Log_Service::get_logger( 'activate_wordlift' );
82
+	$log = Wordlift_Log_Service::get_logger('activate_wordlift');
83 83
 
84
-	$log->info( 'Activating WordLift...' );
84
+	$log->info('Activating WordLift...');
85 85
 
86
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
86
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php';
87 87
 	Wordlift_Activator::activate();
88 88
 
89 89
 	/**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	Top_Entities::activate();
105 105
 
106
-	if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) {
107
-		wp_schedule_event( time(), 'daily', 'wl_daily_cron' );
106
+	if ( ! wp_next_scheduled('wl_daily_cron')) {
107
+		wp_schedule_event(time(), 'daily', 'wl_daily_cron');
108 108
 	}
109 109
 
110 110
 }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function deactivate_wordlift() {
117 117
 
118
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
118
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php';
119 119
 	Wordlift_Deactivator::deactivate();
120 120
 	Wordlift_Http_Api::deactivate();
121 121
 	Ttl_Cache_Cleaner::deactivate();
@@ -131,18 +131,18 @@  discard block
 block discarded – undo
131 131
 	Key_Validation_Notice::remove_notification_flag();
132 132
 	flush_rewrite_rules();
133 133
 
134
-	wp_clear_scheduled_hook( 'wl_daily_cron' );
134
+	wp_clear_scheduled_hook('wl_daily_cron');
135 135
 
136 136
 }
137 137
 
138
-register_activation_hook( __FILE__, 'activate_wordlift' );
139
-register_deactivation_hook( __FILE__, 'deactivate_wordlift' );
138
+register_activation_hook(__FILE__, 'activate_wordlift');
139
+register_deactivation_hook(__FILE__, 'deactivate_wordlift');
140 140
 
141 141
 /**
142 142
  * The core plugin class that is used to define internationalization,
143 143
  * admin-specific hooks, and public-facing site hooks.
144 144
  */
145
-require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php';
145
+require plugin_dir_path(__FILE__).'includes/class-wordlift.php';
146 146
 
147 147
 /**
148 148
  * Begins execution of the plugin.
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 	 * @return bool
163 163
 	 * @since 3.27.6
164 164
 	 */
165
-	if ( apply_filters( 'wl_feature__enable__widgets', true ) ) {
166
-		add_action( 'widgets_init', 'wl_register_chord_widget' );
167
-		add_action( 'widgets_init', 'wl_register_geo_widget' );
168
-		add_action( 'widgets_init', 'wl_register_timeline_widget' );
165
+	if (apply_filters('wl_feature__enable__widgets', true)) {
166
+		add_action('widgets_init', 'wl_register_chord_widget');
167
+		add_action('widgets_init', 'wl_register_geo_widget');
168
+		add_action('widgets_init', 'wl_register_timeline_widget');
169 169
 	}
170
-	add_filter( 'widget_text', 'do_shortcode' );
170
+	add_filter('widget_text', 'do_shortcode');
171 171
 
172 172
 	/**
173 173
 	 * Filter: wl_feature__enable__analysis
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	 * @return bool
178 178
 	 * @since 3.27.6
179 179
 	 */
180
-	if ( apply_filters( 'wl_feature__enable__analysis', true ) ) {
181
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' );
180
+	if (apply_filters('wl_feature__enable__analysis', true)) {
181
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action');
182 182
 	} else {
183
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' );
183
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action');
184 184
 	}
185 185
 
186 186
 	$plugin = new Wordlift();
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
 	add_action(
199 199
 		'plugins_loaded',
200
-		function () {
200
+		function() {
201 201
 			// All features from registry should be initialized here.
202 202
 			$features_registry = Features_Registry::get_instance();
203 203
 			$features_registry->initialize_all_features();
@@ -208,27 +208,27 @@  discard block
 block discarded – undo
208 208
 	add_action(
209 209
 		'plugins_loaded',
210 210
 		// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
211
-		function () use ( $plugin ) {
211
+		function() use ($plugin) {
212 212
 
213 213
 			new Wordlift_Products_Navigator_Shortcode_REST();
214 214
 
215 215
 			// Register the Dataset module, requires `$api_service`.
216
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php';
217
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/shipping-data/index.php';
216
+			require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php';
217
+			require_once plugin_dir_path(__FILE__).'wordlift/shipping-data/index.php';
218 218
 
219 219
 			/*
220 220
 			* Require the Entity annotation cleanup module.
221 221
 			*
222 222
 			* @since 3.34.6
223 223
 			*/
224
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/cleanup/index.php';
224
+			require_once plugin_dir_path(__FILE__).'wordlift/cleanup/index.php';
225 225
 
226 226
 			/*
227 227
 			* Import LOD entities.
228 228
 			*
229 229
 			* @since 3.35.0
230 230
 			*/
231
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/lod-import/index.php';
231
+			require_once plugin_dir_path(__FILE__).'wordlift/lod-import/index.php';
232 232
 
233 233
 		}
234 234
 	);
@@ -246,23 +246,23 @@  discard block
 block discarded – undo
246 246
 function wordlift_plugin_autoload_register() {
247 247
 
248 248
 	spl_autoload_register(
249
-		function ( $class_name ) {
249
+		function($class_name) {
250 250
 
251 251
 			// Bail out if these are not our classes.
252
-			if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) {
252
+			if (0 !== strpos($class_name, 'Wordlift\\')) {
253 253
 				return false;
254 254
 			}
255 255
 
256
-			$class_name_lc = strtolower( str_replace( '_', '-', $class_name ) );
256
+			$class_name_lc = strtolower(str_replace('_', '-', $class_name));
257 257
 
258
-			preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches );
258
+			preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches);
259 259
 
260
-			$path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] );
261
-			$file = 'class-' . $matches[2] . '.php';
260
+			$path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]);
261
+			$file = 'class-'.$matches[2].'.php';
262 262
 
263
-			$full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file;
263
+			$full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file;
264 264
 
265
-			if ( ! file_exists( $full_path ) ) {
265
+			if ( ! file_exists($full_path)) {
266 266
 				return false;
267 267
 			}
268 268
 
@@ -274,13 +274,13 @@  discard block
 block discarded – undo
274 274
 
275 275
 }
276 276
 
277
-function wl_block_categories( $categories ) {
277
+function wl_block_categories($categories) {
278 278
 	return array_merge(
279 279
 		$categories,
280 280
 		array(
281 281
 			array(
282 282
 				'slug'  => 'wordlift',
283
-				'title' => __( 'WordLift', 'wordlift' ),
283
+				'title' => __('WordLift', 'wordlift'),
284 284
 			),
285 285
 		)
286 286
 	);
@@ -290,45 +290,45 @@  discard block
 block discarded – undo
290 290
  * This function is created temporarily to handle the legacy library,
291 291
  * this has to be removed when removing the legacy fields from the ui.
292 292
  */
293
-function wl_enqueue_leaflet( $in_footer = false ) {
293
+function wl_enqueue_leaflet($in_footer = false) {
294 294
 	// Leaflet.
295
-	wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' );
296
-	wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer );
295
+	wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0');
296
+	wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer);
297 297
 }
298 298
 
299
-add_filter( 'block_categories', 'wl_block_categories', 10 );
299
+add_filter('block_categories', 'wl_block_categories', 10);
300 300
 
301 301
 // Temporary fix for a typo in WooCommerce Extension.
302 302
 add_filter(
303 303
 	'wl_feature__enable__dataset',
304
-	function ( $value ) {
305
-		return apply_filters( 'wl_features__enable__dataset', $value );
304
+	function($value) {
305
+		return apply_filters('wl_features__enable__dataset', $value);
306 306
 	}
307 307
 );
308 308
 
309
-require_once __DIR__ . '/modules/food-kg/load.php';
310
-require_once __DIR__ . '/modules/acf4so/load.php';
311
-require_once __DIR__ . '/modules/pods/load.php';
312
-require_once __DIR__ . '/modules/include-exclude-push-config/load.php';
309
+require_once __DIR__.'/modules/food-kg/load.php';
310
+require_once __DIR__.'/modules/acf4so/load.php';
311
+require_once __DIR__.'/modules/pods/load.php';
312
+require_once __DIR__.'/modules/include-exclude-push-config/load.php';
313 313
 
314 314
 add_action(
315 315
 	'update_plugins_adthrive.wordlift.io',
316
-	function ( $update, $plugin_data, $plugin_file, $locales ) {
316
+	function($update, $plugin_data, $plugin_file, $locales) {
317 317
 		// Bail out if it's not our plugin.
318 318
 		$update_uri = $plugin_data['UpdateURI'];
319
-		if ( 'wordlift/wordlift.php' !== $plugin_file || ! isset( $update_uri ) ) {
319
+		if ('wordlift/wordlift.php' !== $plugin_file || ! isset($update_uri)) {
320 320
 			return $update;
321 321
 		}
322 322
 
323
-		$response = wp_remote_get( "$update_uri?nocache=" . time() );
323
+		$response = wp_remote_get("$update_uri?nocache=".time());
324 324
 
325
-		if ( is_wp_error( $response ) ) {
325
+		if (is_wp_error($response)) {
326 326
 			return $update;
327 327
 		}
328 328
 
329 329
 		try {
330
-			return json_decode( wp_remote_retrieve_body( $response ) );
331
-		} catch ( Exception $e ) {
330
+			return json_decode(wp_remote_retrieve_body($response));
331
+		} catch (Exception $e) {
332 332
 			return $update;
333 333
 		}
334 334
 	},
Please login to merge, or discard this patch.
src/includes/class-wordlift-configuration-service.php 1 patch
Spacing   +108 added lines, -108 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 use Wordlift\Api\Default_Api_Service;
14 14
 
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -150,10 +150,10 @@  discard block
 block discarded – undo
150 150
 	 */
151 151
 	protected function __construct() {
152 152
 
153
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
153
+		$this->log = Wordlift_Log_Service::get_logger(get_class());
154 154
 
155 155
 		// Sync some configuration properties when key is validated.
156
-		add_action( 'wl_key_validation_response', array( $this, 'sync' ) );
156
+		add_action('wl_key_validation_response', array($this, 'sync'));
157 157
 
158 158
 	}
159 159
 
@@ -162,15 +162,15 @@  discard block
 block discarded – undo
162 162
 	 *
163 163
 	 * @return void
164 164
 	 */
165
-	public function sync( $response ) {
166
-		if ( ! $response->is_success() ) {
165
+	public function sync($response) {
166
+		if ( ! $response->is_success()) {
167 167
 			return;
168 168
 		}
169
-		$data = json_decode( $response->get_body(), true );
170
-		if ( ! is_array( $data ) || ! array_key_exists( 'networkDatasetId', $data ) ) {
169
+		$data = json_decode($response->get_body(), true);
170
+		if ( ! is_array($data) || ! array_key_exists('networkDatasetId', $data)) {
171 171
 			return;
172 172
 		}
173
-		$this->set_network_dataset_ids( $data['networkDatasetId'] );
173
+		$this->set_network_dataset_ids($data['networkDatasetId']);
174 174
 	}
175 175
 
176 176
 	/**
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 	 */
192 192
 	public static function get_instance() {
193 193
 
194
-		if ( ! isset( self::$instance ) ) {
194
+		if ( ! isset(self::$instance)) {
195 195
 			self::$instance = new self();
196 196
 		}
197 197
 
@@ -209,11 +209,11 @@  discard block
 block discarded – undo
209 209
 	 * @return mixed The configuration value or the default value if not found.
210 210
 	 * @since 3.6.0
211 211
 	 */
212
-	private function get( $option, $key, $default = '' ) {
212
+	private function get($option, $key, $default = '') {
213 213
 
214
-		$options = get_option( $option, array() );
214
+		$options = get_option($option, array());
215 215
 
216
-		return isset( $options[ $key ] ) ? $options[ $key ] : $default;
216
+		return isset($options[$key]) ? $options[$key] : $default;
217 217
 	}
218 218
 
219 219
 	/**
@@ -225,12 +225,12 @@  discard block
 block discarded – undo
225 225
 	 *
226 226
 	 * @since 3.9.0
227 227
 	 */
228
-	private function set( $option, $key, $value ) {
228
+	private function set($option, $key, $value) {
229 229
 
230
-		$values         = get_option( $option );
231
-		$values         = isset( $values ) ? $values : array();
232
-		$values[ $key ] = $value;
233
-		update_option( $option, $values );
230
+		$values         = get_option($option);
231
+		$values         = isset($values) ? $values : array();
232
+		$values[$key] = $value;
233
+		update_option($option, $values);
234 234
 
235 235
 	}
236 236
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 	 */
243 243
 	public function get_entity_base_path() {
244 244
 
245
-		return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' );
245
+		return $this->get('wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity');
246 246
 	}
247 247
 
248 248
 	/**
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @since 3.9.0
254 254
 	 */
255
-	public function set_entity_base_path( $value ) {
255
+	public function set_entity_base_path($value) {
256 256
 
257
-		$this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value );
257
+		$this->set('wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value);
258 258
 
259 259
 	}
260 260
 
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 	 */
267 267
 	public function is_skip_wizard() {
268 268
 
269
-		return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false );
269
+		return $this->get('wl_general_settings', self::SKIP_WIZARD, false);
270 270
 	}
271 271
 
272 272
 	/**
@@ -276,9 +276,9 @@  discard block
 block discarded – undo
276 276
 	 *
277 277
 	 * @since 3.9.0
278 278
 	 */
279
-	public function set_skip_wizard( $value ) {
279
+	public function set_skip_wizard($value) {
280 280
 
281
-		$this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value );
281
+		$this->set('wl_general_settings', self::SKIP_WIZARD, true === $value);
282 282
 
283 283
 	}
284 284
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 */
291 291
 	public function get_key() {
292 292
 
293
-		return $this->get( 'wl_general_settings', self::KEY, '' );
293
+		return $this->get('wl_general_settings', self::KEY, '');
294 294
 	}
295 295
 
296 296
 	/**
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 	 *
301 301
 	 * @since 3.9.0
302 302
 	 */
303
-	public function set_key( $value ) {
303
+	public function set_key($value) {
304 304
 
305
-		$this->set( 'wl_general_settings', self::KEY, $value );
305
+		$this->set('wl_general_settings', self::KEY, $value);
306 306
 	}
307 307
 
308 308
 	/**
@@ -316,11 +316,11 @@  discard block
 block discarded – undo
316 316
 	public function get_language_code() {
317 317
 
318 318
 		$language = get_locale();
319
-		if ( ! $language ) {
319
+		if ( ! $language) {
320 320
 			return 'en';
321 321
 		}
322 322
 
323
-		return substr( $language, 0, 2 );
323
+		return substr($language, 0, 2);
324 324
 	}
325 325
 
326 326
 	/**
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
 	 *
336 336
 	 * @since 3.9.0
337 337
 	 */
338
-	public function set_language_code( $value ) {
338
+	public function set_language_code($value) {
339 339
 
340
-		$this->set( 'wl_general_settings', self::LANGUAGE, $value );
340
+		$this->set('wl_general_settings', self::LANGUAGE, $value);
341 341
 
342 342
 	}
343 343
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
 	 *
349 349
 	 * @since 3.19.0
350 350
 	 */
351
-	public function set_diagnostic_preferences( $value ) {
351
+	public function set_diagnostic_preferences($value) {
352 352
 
353
-		$this->set( 'wl_general_settings', self::SEND_DIAGNOSTIC, $value );
353
+		$this->set('wl_general_settings', self::SEND_DIAGNOSTIC, $value);
354 354
 
355 355
 	}
356 356
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 */
362 362
 	public function get_diagnostic_preferences() {
363 363
 
364
-		return $this->get( 'wl_general_settings', self::SEND_DIAGNOSTIC, 'no' );
364
+		return $this->get('wl_general_settings', self::SEND_DIAGNOSTIC, 'no');
365 365
 	}
366 366
 
367 367
 	/**
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 	 */
373 373
 	public function get_country_code() {
374 374
 
375
-		return $this->get( 'wl_general_settings', self::COUNTRY_CODE, 'us' );
375
+		return $this->get('wl_general_settings', self::COUNTRY_CODE, 'us');
376 376
 	}
377 377
 
378 378
 	/**
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
 	 *
383 383
 	 * @since 3.18.0
384 384
 	 */
385
-	public function set_country_code( $value ) {
385
+	public function set_country_code($value) {
386 386
 
387
-		$this->set( 'wl_general_settings', self::COUNTRY_CODE, $value );
387
+		$this->set('wl_general_settings', self::COUNTRY_CODE, $value);
388 388
 
389 389
 	}
390 390
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 	 * @since 3.38.6
398 398
 	 */
399 399
 	public function get_alternate_name() {
400
-		return $this->get( 'wl_general_settings', self::ALTERNATE_NAME );
400
+		return $this->get('wl_general_settings', self::ALTERNATE_NAME);
401 401
 	}
402 402
 
403 403
 	/**
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
 	 *
408 408
 	 * @since 3.38.6
409 409
 	 */
410
-	public function set_alternate_name( $value ) {
410
+	public function set_alternate_name($value) {
411 411
 
412
-		$this->set( 'wl_general_settings', self::ALTERNATE_NAME, wp_strip_all_tags( $value ) );
412
+		$this->set('wl_general_settings', self::ALTERNATE_NAME, wp_strip_all_tags($value));
413 413
 
414 414
 	}
415 415
 
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 	 */
425 425
 	public function get_publisher_id() {
426 426
 
427
-		return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null );
427
+		return $this->get('wl_general_settings', self::PUBLISHER_ID, null);
428 428
 	}
429 429
 
430 430
 	/**
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
 	 *
435 435
 	 * @since 3.9.0
436 436
 	 */
437
-	public function set_publisher_id( $value ) {
437
+	public function set_publisher_id($value) {
438 438
 
439
-		$this->set( 'wl_general_settings', self::PUBLISHER_ID, $value );
439
+		$this->set('wl_general_settings', self::PUBLISHER_ID, $value);
440 440
 
441 441
 	}
442 442
 
@@ -449,8 +449,8 @@  discard block
 block discarded – undo
449 449
 	 */
450 450
 	public function get_dataset_uri() {
451 451
 
452
-		if ( apply_filters( 'wl_feature__enable__dataset', true ) ) {
453
-			return $this->get( 'wl_advanced_settings', self::DATASET_URI, null );
452
+		if (apply_filters('wl_feature__enable__dataset', true)) {
453
+			return $this->get('wl_advanced_settings', self::DATASET_URI, null);
454 454
 		} else {
455 455
 			return null;
456 456
 		}
@@ -463,9 +463,9 @@  discard block
 block discarded – undo
463 463
 	 *
464 464
 	 * @since 3.10.0
465 465
 	 */
466
-	public function set_dataset_uri( $value ) {
466
+	public function set_dataset_uri($value) {
467 467
 
468
-		$this->set( 'wl_advanced_settings', self::DATASET_URI, $value );
468
+		$this->set('wl_advanced_settings', self::DATASET_URI, $value);
469 469
 	}
470 470
 
471 471
 	/**
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 	 */
477 477
 	public function get_package_type() {
478 478
 
479
-		return $this->get( 'wl_advanced_settings', self::PACKAGE_TYPE, null );
479
+		return $this->get('wl_advanced_settings', self::PACKAGE_TYPE, null);
480 480
 	}
481 481
 
482 482
 	/**
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 	 *
487 487
 	 * @since 3.20.0
488 488
 	 */
489
-	public function set_package_type( $value ) {
490
-		$this->set( 'wl_advanced_settings', self::PACKAGE_TYPE, $value );
489
+	public function set_package_type($value) {
490
+		$this->set('wl_advanced_settings', self::PACKAGE_TYPE, $value);
491 491
 	}
492 492
 
493 493
 	/**
@@ -502,11 +502,11 @@  discard block
 block discarded – undo
502 502
 	 * @param array $old_value The old settings.
503 503
 	 * @param array $new_value The new settings.
504 504
 	 */
505
-	public function update_key( $old_value, $new_value ) {
505
+	public function update_key($old_value, $new_value) {
506 506
 
507 507
 		// Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed.
508 508
 		// $old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
509
-		$new_key = isset( $new_value['key'] ) ? $new_value['key'] : '';
509
+		$new_key = isset($new_value['key']) ? $new_value['key'] : '';
510 510
 
511 511
 		// If the key hasn't changed, don't do anything.
512 512
 		// WARN The 'update_option' hook is fired only if the new and old value are not equal.
@@ -515,14 +515,14 @@  discard block
 block discarded – undo
515 515
 		// }
516 516
 
517 517
 		// If the key is empty, empty the dataset URI.
518
-		if ( '' === $new_key ) {
519
-			$this->set_dataset_uri( '' );
518
+		if ('' === $new_key) {
519
+			$this->set_dataset_uri('');
520 520
 		}
521 521
 
522 522
 		// make the request to the remote server.
523
-		$this->get_remote_dataset_uri( $new_key );
523
+		$this->get_remote_dataset_uri($new_key);
524 524
 
525
-		do_action( 'wl_key_updated' );
525
+		do_action('wl_key_updated');
526 526
 
527 527
 	}
528 528
 
@@ -538,15 +538,15 @@  discard block
 block discarded – undo
538 538
 	 *
539 539
 	 * @since 3.17.0 send the site URL and get the dataset URI.
540 540
 	 */
541
-	public function get_remote_dataset_uri( $key ) {
541
+	public function get_remote_dataset_uri($key) {
542 542
 
543
-		$this->log->trace( 'Getting the remote dataset URI and package type...' );
543
+		$this->log->trace('Getting the remote dataset URI and package type...');
544 544
 
545
-		if ( empty( $key ) ) {
546
-			$this->log->warn( 'Key set to empty value.' );
545
+		if (empty($key)) {
546
+			$this->log->warn('Key set to empty value.');
547 547
 
548
-			$this->set_dataset_uri( '' );
549
-			$this->set_package_type( null );
548
+			$this->set_dataset_uri('');
549
+			$this->set_package_type(null);
550 550
 
551 551
 			return;
552 552
 		}
@@ -560,15 +560,15 @@  discard block
 block discarded – undo
560 560
 		 *
561 561
 		 * @since 3.20.0
562 562
 		 */
563
-		$home_url = get_option( 'home' );
564
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
563
+		$home_url = get_option('home');
564
+		$site_url = apply_filters('wl_production_site_url', untrailingslashit($home_url));
565 565
 
566 566
 		// Build the URL.
567 567
 		$url = '/accounts'
568
-				. '?key=' . rawurlencode( $key )
569
-				. '&url=' . rawurlencode( $site_url )
570
-				. '&country=' . $this->get_country_code()
571
-				. '&language=' . $this->get_language_code();
568
+				. '?key='.rawurlencode($key)
569
+				. '&url='.rawurlencode($site_url)
570
+				. '&country='.$this->get_country_code()
571
+				. '&language='.$this->get_language_code();
572 572
 
573 573
 		$api_service = Default_Api_Service::get_instance();
574 574
 		/**
@@ -578,32 +578,32 @@  discard block
 block discarded – undo
578 578
 		$headers  = array(
579 579
 			'Authorization' => "Key $key",
580 580
 		);
581
-		$response = $api_service->request( 'PUT', $url, $headers )->get_response();
581
+		$response = $api_service->request('PUT', $url, $headers)->get_response();
582 582
 
583 583
 		// The response is an error.
584
-		if ( is_wp_error( $response ) ) {
585
-			$this->log->error( 'An error occurred setting the dataset URI: ' . $response->get_error_message() );
584
+		if (is_wp_error($response)) {
585
+			$this->log->error('An error occurred setting the dataset URI: '.$response->get_error_message());
586 586
 
587
-			$this->set_dataset_uri( '' );
588
-			$this->set_package_type( null );
587
+			$this->set_dataset_uri('');
588
+			$this->set_package_type(null);
589 589
 
590 590
 			return;
591 591
 		}
592 592
 
593 593
 		// The response is not OK.
594
-		if ( ! is_array( $response ) || 200 !== (int) $response['response']['code'] ) {
594
+		if ( ! is_array($response) || 200 !== (int) $response['response']['code']) {
595 595
 			$base_url = $api_service->get_base_url();
596 596
 
597
-			if ( ! is_array( $response ) ) {
597
+			if ( ! is_array($response)) {
598 598
 				// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
599
-				$this->log->error( "Unexpected response when opening URL $base_url$url: " . var_export( $response, true ) );
599
+				$this->log->error("Unexpected response when opening URL $base_url$url: ".var_export($response, true));
600 600
 			} else {
601 601
 				// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
602
-				$this->log->error( "Unexpected status code when opening URL $base_url$url: " . $response['response']['code'] . "\n" . var_export( $response, true ) );
602
+				$this->log->error("Unexpected status code when opening URL $base_url$url: ".$response['response']['code']."\n".var_export($response, true));
603 603
 			}
604 604
 
605
-			$this->set_dataset_uri( '' );
606
-			$this->set_package_type( null );
605
+			$this->set_dataset_uri('');
606
+			$this->set_package_type(null);
607 607
 
608 608
 			return;
609 609
 		}
@@ -613,20 +613,20 @@  discard block
 block discarded – undo
613 613
 		 *
614 614
 		 * @since 3.20.0
615 615
 		 */
616
-		$json = json_decode( $response['body'] );
616
+		$json = json_decode($response['body']);
617 617
 		/**
618 618
 		 * @since 3.27.7
619 619
 		 * Remove the trailing slash returned from the new platform api.
620 620
 		 */
621 621
 		// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
622
-		$dataset_uri = untrailingslashit( $json->datasetURI );
622
+		$dataset_uri = untrailingslashit($json->datasetURI);
623 623
 		// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
624
-		$package_type = isset( $json->packageType ) ? $json->packageType : null;
624
+		$package_type = isset($json->packageType) ? $json->packageType : null;
625 625
 
626
-		$this->log->info( "Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]..." );
626
+		$this->log->info("Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]...");
627 627
 
628
-		$this->set_dataset_uri( $dataset_uri );
629
-		$this->set_package_type( $package_type );
628
+		$this->set_dataset_uri($dataset_uri);
629
+		$this->set_package_type($package_type);
630 630
 	}
631 631
 
632 632
 	/**
@@ -643,20 +643,20 @@  discard block
 block discarded – undo
643 643
 	 * @return mixed The same value in the $value parameter
644 644
 	 * @since 3.12.0
645 645
 	 */
646
-	public function maybe_update_dataset_uri( $value, $old_value ) {
646
+	public function maybe_update_dataset_uri($value, $old_value) {
647 647
 
648 648
 		// Check the old key value and the new one. Here we're only handling the
649 649
 		// case where the key hasn't changed and the dataset URI isn't set. The
650 650
 		// other case, i.e. a new key is inserted, is handled at `update_key`.
651
-		$old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
652
-		$new_key = isset( $value['key'] ) ? $value['key'] : '';
651
+		$old_key = isset($old_value['key']) ? $old_value['key'] : '';
652
+		$new_key = isset($value['key']) ? $value['key'] : '';
653 653
 
654 654
 		$dataset_uri = $this->get_dataset_uri();
655 655
 
656
-		if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) {
656
+		if ( ! empty($new_key) && $new_key === $old_key && empty($dataset_uri)) {
657 657
 
658 658
 			// make the request to the remote server to try to get the dataset uri.
659
-			$this->get_remote_dataset_uri( $new_key );
659
+			$this->get_remote_dataset_uri($new_key);
660 660
 		}
661 661
 
662 662
 		return $value;
@@ -670,9 +670,9 @@  discard block
 block discarded – undo
670 670
 	 * @return string The API URI.
671 671
 	 * @since 3.11.0
672 672
 	 */
673
-	public function get_accounts_by_key_dataset_uri( $key ) {
673
+	public function get_accounts_by_key_dataset_uri($key) {
674 674
 
675
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri";
675
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE."accounts/key=$key/dataset_uri";
676 676
 	}
677 677
 
678 678
 	/**
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
 	 */
684 684
 	public function get_accounts() {
685 685
 
686
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'accounts';
686
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'accounts';
687 687
 	}
688 688
 
689 689
 	/**
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
 	 */
695 695
 	public function is_link_by_default() {
696 696
 
697
-		return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' );
697
+		return 'yes' === $this->get('wl_general_settings', self::LINK_BY_DEFAULT, 'yes');
698 698
 	}
699 699
 
700 700
 	/**
@@ -704,9 +704,9 @@  discard block
 block discarded – undo
704 704
 	 *
705 705
 	 * @since 3.13.0
706 706
 	 */
707
-	public function set_link_by_default( $value ) {
707
+	public function set_link_by_default($value) {
708 708
 
709
-		$this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' );
709
+		$this->set('wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no');
710 710
 	}
711 711
 
712 712
 	/**
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
 	 * @since 3.21.0
717 717
 	 */
718 718
 	public function is_analytics_enable() {
719
-		return 'yes' === $this->get( 'wl_analytics_settings', self::ANALYTICS_ENABLE, 'no' );
719
+		return 'yes' === $this->get('wl_analytics_settings', self::ANALYTICS_ENABLE, 'no');
720 720
 	}
721 721
 
722 722
 	/**
@@ -726,9 +726,9 @@  discard block
 block discarded – undo
726 726
 	 *
727 727
 	 * @since 3.21.0
728 728
 	 */
729
-	public function set_is_analytics_enable( $value ) {
729
+	public function set_is_analytics_enable($value) {
730 730
 
731
-		$this->set( 'wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no' );
731
+		$this->set('wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no');
732 732
 	}
733 733
 
734 734
 	/**
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
 	 * @since 3.21.0
739 739
 	 */
740 740
 	public function get_analytics_entity_uri_dimension() {
741
-		return (int) $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 1 );
741
+		return (int) $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 1);
742 742
 	}
743 743
 
744 744
 	/**
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 	 * @since 3.21.0
749 749
 	 */
750 750
 	public function get_analytics_entity_type_dimension() {
751
-		return $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 2 );
751
+		return $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 2);
752 752
 	}
753 753
 
754 754
 	/**
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
 	 */
760 760
 	public function get_autocomplete_url() {
761 761
 
762
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete';
762
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'autocomplete';
763 763
 
764 764
 	}
765 765
 
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 	 */
772 772
 	public function get_deactivation_feedback_url() {
773 773
 
774
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'feedbacks';
774
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'feedbacks';
775 775
 
776 776
 	}
777 777
 
@@ -787,24 +787,24 @@  discard block
 block discarded – undo
787 787
 	}
788 788
 
789 789
 	public function get_network_dataset_ids() {
790
-		return $this->get( 'wl_advanced_settings', self::NETWORK_DATASET_IDS, array() );
790
+		return $this->get('wl_advanced_settings', self::NETWORK_DATASET_IDS, array());
791 791
 	}
792 792
 
793
-	public function set_network_dataset_ids( $network_dataset_ids ) {
794
-		$this->set( 'wl_advanced_settings', self::NETWORK_DATASET_IDS, $network_dataset_ids );
793
+	public function set_network_dataset_ids($network_dataset_ids) {
794
+		$this->set('wl_advanced_settings', self::NETWORK_DATASET_IDS, $network_dataset_ids);
795 795
 	}
796 796
 
797 797
 
798 798
 
799 799
 	public function get_skip_installation_notice() {
800 800
 
801
-		return $this->get( 'wl_general_settings', self::SKIP_INSTALLATION_NOTICE, false );
801
+		return $this->get('wl_general_settings', self::SKIP_INSTALLATION_NOTICE, false);
802 802
 	}
803 803
 
804 804
 
805
-	public function set_skip_installation_notice( $value ) {
805
+	public function set_skip_installation_notice($value) {
806 806
 
807
-		$this->set( 'wl_general_settings', self::SKIP_INSTALLATION_NOTICE, $value );
807
+		$this->set('wl_general_settings', self::SKIP_INSTALLATION_NOTICE, $value);
808 808
 
809 809
 	}
810 810
 
Please login to merge, or discard this patch.
src/wordlift/admin/class-installation-complete-notice.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,20 +6,20 @@  discard block
 block discarded – undo
6 6
 
7 7
 	public function init() {
8 8
 
9
-		add_action( 'admin_init', array( $this, 'handle_notice' ) );
9
+		add_action('admin_init', array($this, 'handle_notice'));
10 10
 
11 11
 		add_action(
12 12
 			'wordlift_admin_notices',
13
-			function () {
13
+			function() {
14 14
 
15 15
 				?>
16 16
 				<div class="updated">
17
-					<H3><?php echo esc_html( get_plugin_data( WORDLIFT_PLUGIN_FILE )['Name'] ); ?> <?php esc_html_e( 'has been successfully installed on your site!' ); ?></H3>
18
-					<p><?php esc_html_e( 'we\'re now automatically enriching the structured data on your posts to create the best representation of your content that search engines will understand. Time to look forward to an increase in organic traffic!', 'wordlift' ); ?></p>
17
+					<H3><?php echo esc_html(get_plugin_data(WORDLIFT_PLUGIN_FILE)['Name']); ?> <?php esc_html_e('has been successfully installed on your site!'); ?></H3>
18
+					<p><?php esc_html_e('we\'re now automatically enriching the structured data on your posts to create the best representation of your content that search engines will understand. Time to look forward to an increase in organic traffic!', 'wordlift'); ?></p>
19 19
 					<p><u>
20 20
 							<a
21
-									href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'wl_hide_installation_notice', true ), 'wordlift_hide_installation_notice_nonce', '_wl_hide_installation_notice_nonce' ) ); ?>">
22
-								<?php esc_html_e( 'Dismiss', 'wordlift' ); ?>
21
+									href="<?php echo esc_url(wp_nonce_url(add_query_arg('wl_hide_installation_notice', true), 'wordlift_hide_installation_notice_nonce', '_wl_hide_installation_notice_nonce')); ?>">
22
+								<?php esc_html_e('Dismiss', 'wordlift'); ?>
23 23
 							</a>
24 24
 						</u>
25 25
 					</p>
@@ -31,16 +31,16 @@  discard block
 block discarded – undo
31 31
 	}
32 32
 
33 33
 	public function handle_notice() {
34
-		if ( ! isset( $_GET['wl_hide_installation_notice'] ) || ! isset( $_GET['_wl_hide_installation_notice_nonce'] ) ) {
34
+		if ( ! isset($_GET['wl_hide_installation_notice']) || ! isset($_GET['_wl_hide_installation_notice_nonce'])) {
35 35
 			return;
36 36
 		}
37 37
 
38
-		if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wl_hide_installation_notice_nonce'] ) ), 'wordlift_hide_installation_notice_nonce' )
39
-		|| ! current_user_can( 'manage_options' ) ) {
40
-			wp_die( esc_html__( 'Action failed.', 'wordlift' ) );
38
+		if ( ! wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['_wl_hide_installation_notice_nonce'])), 'wordlift_hide_installation_notice_nonce')
39
+		|| ! current_user_can('manage_options')) {
40
+			wp_die(esc_html__('Action failed.', 'wordlift'));
41 41
 		}
42 42
 
43
-		\Wordlift_Configuration_Service::get_instance()->set_skip_installation_notice( true );
43
+		\Wordlift_Configuration_Service::get_instance()->set_skip_installation_notice(true);
44 44
 
45 45
 	}
46 46
 
Please login to merge, or discard this patch.