Conditions | 1 |
Paths | 1 |
Total Lines | 91 |
Code Lines | 74 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
71 | public function get_privacy_message() { |
||
72 | $content = ''; |
||
73 | |||
74 | // Start of the suggested privacy policy text. |
||
75 | $content .= |
||
76 | '<div class="geodir-privacy-text">'; |
||
77 | $content .= |
||
78 | '<h2>' . __( 'Who we are' ) . '</h2>'; |
||
79 | $content .= |
||
80 | '<p>' . __( 'GeoDirectory is the only WordPress directory plugin on the market that can scale to millions of listings and withstand the battering of traffic that comes along with that.' ) . '</p>'; |
||
81 | |||
82 | '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>'; |
||
83 | $content .= |
||
84 | '<p>' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>' . |
||
85 | '<p>' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>' . |
||
86 | '<p>' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>' . |
||
87 | '<p>' . __( 'Personal data is not just created by a user’s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>' . |
||
88 | '<p>' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>'; |
||
89 | |||
90 | $content .= |
||
91 | '<h3>' . __( 'Posts' ) . '</h3>'; |
||
92 | $content .= |
||
93 | '<p>' . __( 'In this subsection you should note what information is captured through posts. We have noted the data which WordPress collects by default.' ) . '</p>' . |
||
94 | '<p>' . __( 'When users add posts on the site we collect the data shown in the posts form, and also the visitor’s IP address and browser user agent string to help spam detection.' ) . '</p>' . |
||
95 | '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your post, your profile picture is visible to the public in the context of your post.' ) . '</p>'; |
||
96 | |||
97 | $content .= |
||
98 | '<h3>' . __( 'Reviews' ) . '</h3>'; |
||
99 | $content .= |
||
100 | '<p>' . __( 'In this subsection you should note what information is captured through reviews. We have noted the data which WordPress collects by default.' ) . '</p>' . |
||
101 | '<p>' . __( 'When visitors leave reviews on the site we collect the data shown in the reviews form, and also the visitor’s IP address and browser user agent string to help spam detection.' ) . '</p>' . |
||
102 | '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your review, your profile picture is visible to the public in the context of your review.' ) . '</p>'; |
||
103 | |||
104 | $content .= |
||
105 | '<h3>' . __( 'Media' ) . '</h3>'; |
||
106 | $content .= |
||
107 | '<p>' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>' . |
||
108 | '<p>' . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>'; |
||
109 | |||
110 | $content .= |
||
111 | '<h2>' . __( 'How long we retain your data' ) . '</h2>'; |
||
112 | $content .= |
||
113 | '<p>' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>' . |
||
114 | '<p>' . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>' . |
||
115 | '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>' . |
||
116 | |||
117 | '<h2>' . __( 'What rights you have over your data' ) . '</h2>'; |
||
118 | $content .= |
||
119 | '<p>' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>' . |
||
120 | '<p>' . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>'; |
||
121 | |||
122 | $content .= |
||
123 | '<h2>' . __( 'Where we send your data' ) . '</h2>'; |
||
124 | $content .= |
||
125 | '<p>' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>' . |
||
126 | '<p>' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>' . |
||
127 | '<p>' . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>'; |
||
128 | |||
129 | $content .= |
||
130 | '<h2>' . __( 'Additional information' ) . '</h2>'; |
||
131 | $content .= |
||
132 | '<p>' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>'; |
||
133 | |||
134 | $content .= |
||
135 | '<h3>' . __( 'How we protect your data' ) . '</h3>'; |
||
136 | $content .= |
||
137 | '<p>' . __( 'In this section you should explain what measures you have taken to protect your users’ data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>'; |
||
138 | |||
139 | $content .= |
||
140 | '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>'; |
||
141 | $content .= |
||
142 | '<p>' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>'; |
||
143 | |||
144 | $content .= |
||
145 | '<h3>' . __( 'What third parties we receive data from' ) . '</h3>'; |
||
146 | $content .= |
||
147 | '<p>' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>'; |
||
148 | |||
149 | $content .= |
||
150 | '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>'; |
||
151 | $content .= |
||
152 | '<p>' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>'; |
||
153 | |||
154 | $content .= |
||
155 | '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>'; |
||
156 | $content .= |
||
157 | '<p>' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>' . |
||
158 | '</div>'; |
||
159 | |||
160 | return apply_filters( 'geodir_privacy_policy_content', $content ); |
||
161 | } |
||
162 | |||
340 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.